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 |
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2009-08-01 : 04:59:09
|
| How can I do something like this:@temp_table_name is a variable to hold the data table name?fn_true_csv_split is a UDFSELECT RowNum ,WholeRow = dbo.fn_true_csv_split(s.WholeRow,'|')INTO #StagingBFROM @temp_table_nameThanks! |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2009-08-01 : 05:19:28
|
| Nevermind this works:declare @temp_table_name varchar(255), @temp_table_name2 varchar(255)set @temp_table_name = '[staging1]'set @temp_table_name2 = '[staging2]'Exec ('SELECT RowNum , WholeRow = dbo.fn_true_csv_split(WholeRow,''|'') INTO ' + @temp_table_name2 + ' FROM ' + @temp_table_name) |
 |
|
|
|
|
|