Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)

  • RE: How to list the column name(s) which are Primary key(s) of any table?

    Hi!

    Below is the query that will give you the primary key constraint names and the columns used in them for all the user created tables in your database.

    SELECT OBJ.NAME, COLS.CONSTRAINT_NAME,COLS.COLUMN_NAME,COLS.ORDINAL_POSITION

    FROM...


    Best Regards,

    Indu Jakhar

  • RE: Import Question

    Hi!

    If you have all numeric values only in that column of your table it can be inserted without any special handeling, I have given an example pls try this...

    Probably this...


    Best Regards,

    Indu Jakhar

  • RE: Display Table name and columns

    Hi!

    try this script, probably solve your purpose....

    select table_name, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, isnull( convert(varchar, CHARACTER_MAXIMUM_LENGTH), '-NA-') as CHARACTER_MAXIMUM_LENGTH 

    from information_schema.columns

    order by table_name


    Best Regards,

    Indu Jakhar

  • RE: How to insert image in a table??

    Hi wz700!

    I want to give my user an option to upload a picture and store it in SQL 7.0 database, how can I acheive that, I tried to get the...


    Best Regards,

    Indu Jakhar

  • RE: "Insert" Problems

    There can be two solutions for this problem:

    1) Specify the default values for the columns in the table structure itself and specify the column list in insert statement.

    2) Add the...


    Best Regards,

    Indu Jakhar

  • RE: Best method for Delete Procedures

    Hi!

    There can be two ways of doing it:

    1) truncate table on the production server and then insert all the records from STAGING server to PROD server.

    2) the second option that you...


    Best Regards,

    Indu Jakhar

  • RE: select statement woes...

    Hi!

    tried to simulate your problem with temporary tables and following is the code for that, probably it will help you. You need to use charindex for checking the employeeID's existance...


    Best Regards,

    Indu Jakhar

  • RE: How could I copy several tables from one owner to other in the same database

    sp_changeobjectowner

    will work if the person wants to change the owner of the object but it seems that in this case its required to keep the object with original owner...


    Best Regards,

    Indu Jakhar

  • RE: How to delete all but 1?

    Hi!

    Probably this code will help you.....

    delete RoleModule

    where roleModule_ID not in (select max(roleModule_ID) from RoleModule

        group by Role_ID

        having count(*) > 1 )

    and Role_ID in (select Role_ID from RoleModule b

        group by...


    Best Regards,

    Indu Jakhar

  • RE: Removing certain records of a SQL Server table

    Hi!

    You can write the delete statement based on need i.e. where the difference of invoice date and current date is greater than equal to 48 months. This delete statement can...


    Best Regards,

    Indu Jakhar

Viewing 10 posts - 1 through 10 (of 10 total)