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 |
|
subashmvs
Starting Member
4 Posts |
Posted - 2008-03-12 : 06:42:14
|
| hi,when I try the following query an error is ocuuredCREATE TABLE tb1 AS ( SELECT * FROM Tab2 )Is it not support in SQL Server 2005? |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-12 : 06:43:05
|
| [code]Select * into tb1 from tab2[/code][EDIT] Note that for large tables this is not recommended.Instead you can script of tab2, rename table name to tb1, execute the script to create table and use regular INSERT statement to populate data.Also note that, above statement won't copy the indexes and other constraints which exists on original table.[END EDIT]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-03-12 : 06:51:12
|
To avoid locks on source table, tryselect top 0 * into tb1 from tab2insert tb1 select * from tab2 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
subashmvs
Starting Member
4 Posts |
Posted - 2008-03-12 : 06:53:24
|
| thanx harsh...its very informative.. becoz i am femiliar in oracle Query, not much in SQL server |
 |
|
|
|
|
|