Author |
Topic |
Jim Beam
Posting Yak Master
137 Posts |
Posted - 2010-10-01 : 12:04:54
|
Hi all, Any idea how to do this? I copied data from a table and inserted in into another with the same column names.Cheers,Jim |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-01 : 12:07:09
|
That is no REcreate.Skript out the indexes from the source table and execute it adapted on the new table. No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
Jim Beam
Posting Yak Master
137 Posts |
Posted - 2010-10-01 : 12:20:10
|
quote: Originally posted by webfred That is no REcreate.Skript out the indexes from the source table and execute it adapted on the new table. No, you're never too old to Yak'n'Roll if you're too young to die.
Using 'Alter Table'? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-01 : 12:29:44
|
Yes.What I would do:Go to the object explorerExpand databasesExpand your tableExpand indexesRight click the index and choose create to a new query windowThis will generate the ALTER statement for youChange the tablenameexecute it in the database which holds the new tableThat should work. No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Jim Beam
Posting Yak Master
137 Posts |
Posted - 2010-10-01 : 13:48:30
|
quote: Originally posted by webfred Yes.What I would do:Go to the object explorerExpand databasesExpand your tableExpand indexesRight click the index and choose create to a new query windowThis will generate the ALTER statement for youChange the tablenameexecute it in the database which holds the new tableThat should work. No, you're never too old to Yak'n'Roll if you're too young to die.
That indeed works, danke! Rather laborious process on a Friday night, the Clustered Index build is taking an age at a time when I ought to be in the pub...:) |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-03 : 13:32:59
|
when I ought to be in the pub...Take a netbook with you No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-10-04 : 01:47:03
|
quote: Originally posted by Jim Beam
quote: Originally posted by webfred Yes.What I would do:Go to the object explorerExpand databasesExpand your tableExpand indexesRight click the index and choose create to a new query windowThis will generate the ALTER statement for youChange the tablenameexecute it in the database which holds the new tableThat should work. No, you're never too old to Yak'n'Roll if you're too young to die.
That indeed works, danke! Rather laborious process on a Friday night, the Clustered Index build is taking an age at a time when I ought to be in the pub...:)
Well you can set the option SORT_IN_TEMPDB=ON in the index creation script.It will give the necessary testosterone boost for the index creation http://msdn.microsoft.com/en-us/library/ms188281.aspxEdit:Corrected the hyperlinkPBUH |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-10-04 : 04:23:24
|
quote: Originally posted by Sachin.Nand
quote: Originally posted by Jim Beam
quote: Originally posted by webfred Yes.What I would do:Go to the object explorerExpand databasesExpand your tableExpand indexesRight click the index and choose create to a new query windowThis will generate the ALTER statement for youChange the tablenameexecute it in the database which holds the new tableThat should work. No, you're never too old to Yak'n'Roll if you're too young to die.
That indeed works, danke! Rather laborious process on a Friday night, the Clustered Index build is taking an age at a time when I ought to be in the pub...:)
Well you can set the option SORT_IN_TEMPDB=ON in the index creation script.It will give the necessary testosterone boost for the index creation http://msdn.microsoft.com/en-us/library/ms18828(SQL.100).aspxPBUH
LOL. Nice one Sachin!Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|