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 |
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-11-02 : 14:47:23
|
| What's the syntax to Select ----Into a Temp Table? |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-02 : 14:51:41
|
| I disagree that this is a duplicate.The syntax for inserting into a temp table is the same as if it were a regular table. The only difference is that you put # before the object name.Here are two ways:SELECT ...INTO #TempFROM ...WHERE ...OrCREATE TABLE #Temp (...)INSERT INTO #Temp (...)SELECT ...FROM ...WHERE...Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-11-02 : 14:55:11
|
| Thanks !!! |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-11-02 : 17:15:42
|
Looks like something happened there.. for a moment the thread was locked.. I thgt I saw the same question in the other thread.. or is it the friday... Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-02 : 17:53:05
|
| I locked it when I saw your post about it being a duplicate. I then looked at both threads more closely and decided to unlock this one.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-11-02 : 18:02:40
|
quote: Originally posted by tkizer I locked it when I saw your post about it being a duplicate. I then looked at both threads more closely and decided to unlock this one.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/
Oops... sorry if I misguided you...Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
|
|
|