Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mike009
Starting Member
15 Posts |
Posted - 2006-03-20 : 01:19:45
|
| heyif i want to copy a table into totaly new table(that not created yet)if i use the followin statement create table studentcopy select * from studenti receive that there is error near 'select'if i want use the following statementinsert into table studentcopy select * from studentin this case i got error that studentcopy table doesnot existi use MS SQL how can i copy table to new table if it is not possible and i have to create empty table first beforecopying the content from the other table, then how can i return the structure of the original table to creat same table exactly (mean how can i get the info of how the student table is created using qury)thx |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-03-20 : 01:24:31
|
[code]select * into studentcopy table from student[/code] KHChoice is an illusion, created between those with power, and those without.Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-20 : 01:31:58
|
| If you use Select * into then the created table wont have the indices that source table has.Create target table with the same structure of source table then apply this logicinsert into table studentcopy select * from studentMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|