Seeking new owner for this high-traffic DBAzine.com site.
Tap into the potential of this DBA community to expand your business! Interested? Contact us today. |
|
Transaction Management
Reduce downtime and increase repeat sales by improving end-user experience. Free White Paper
Database Recovery
Feeling the increased demands on data protection and storage requirements? Download Free Report! |
instead i am bound to insert like this...
Insert into productsduplicate SELECT * FROM products.
it is asking me to specify column list..
I shall be glad if you can let me know if there is any way that i can achieve that without specifying column list
or is that the way i am bound to specify columns also.
i use SQLSERVER2000
With Regards,
chid
The best practice is to always specify a column list when you can. If you can't or for some reason to design a solution where you won't know the composition of the columns, you can use a SELECT INTO statement in order to create a table which has the results of your select statement. This usually means that there cannot be an existing table with a differet sent of data and that the table created by the SELECT INTO will be the only one that can exist with the specified set of data, unless you run subsequent insert statements.
Hope this helps.