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 |
|
GoDaddy
Yak Posting Veteran
64 Posts |
Posted - 2009-02-25 : 09:22:37
|
| I want to return a structure ColumnA, ColumnB, ColumnC, ColumnDFrom a table that only contains ColumnA, ColumnB. I thought in my script of creating a #Temp table with all 4 columns. But I don't know how to select data from the table to put them into that #Temp table |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-25 : 09:28:17
|
| [code]SELECT ColumnA,ColumnB,CAST(NULL AS datatype) AS ColumnC,CAST(NULL AS datatype) AS ColumnD INTO #Temp FROM Table[/code]make sure you replace datatype with the appropriate ones you want for other two columns |
 |
|
|
GoDaddy
Yak Posting Veteran
64 Posts |
Posted - 2009-02-25 : 09:38:05
|
| Thanks! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-25 : 09:41:15
|
| welcome |
 |
|
|
|
|
|