T-SQL

  • I have one table in my database Employee

    There are three columns in employee table and in table i have 10 records.Now I want to create new table having the columns which are in Employee Table But i don't want when i create table using the employee table the records resides in employee table should not be transferred to new tables using The SQL Query i.e Create Table Or Some other.

  • could you post the query that you are using currently. Also try appending -- where 1=2 to your query. i think this should help you.

    Paras Shah

    Evision Technologies

    Mumbai, India


    Paras Shah
    Evision Technologies
    Mumbai, India

  • You can use this SQL trick to copy the table structure but not any data toa new table

    select *

    into anewtable

    from sometable

    where somecolumn=a and somecolumn != a

    This will duplicate the table structure minus keys, foreign key relationships, defaults, permissions etc.

  • I use

    select top 0 *

    into anewtable

    from sometable

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply