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 |
|
phrankbooth
Posting Yak Master
162 Posts |
Posted - 2007-09-19 : 16:46:06
|
| I keep getting a declare error on this:DECLARE @SplitTable TABLE(Idx BIGINT IDENTITY(1,1), SplitData VARCHAR(20), Size INT)SET @SplitTable = dbo.SplitToTable('|', '1|One|0:26:20|541|abc|xxx|6:26:33|21705') All I want to do is assign the table that my function returns to a variable. Should be easy, but I tried the above and assigning with 'as':select * from dbo.SplitToTable('|','1|One|0:26:20|541|abc|xxx|6:26:33|21705') as Splitthat didn't work either.Also tried:DECLARE @SplitTable TABLE(Idx BIGINT IDENTITY(1,1), SplitData VARCHAR(20), Size INT)select @SplitTable= from dbo.SplitToTable('|','1|One|0:26:20|541|abc|xxx|6:26:33|21705')what am I missing?--PhB |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-19 : 16:49:05
|
An INSERT statement?INSERT @SplitTable (SplitData, Size)SELECT Data, LEN(Data) FROM dbo.SplitTable('|','1|One|0:26:20|541|abc|xxx|6:26:33|21705') AS Split E 12°55'05.25"N 56°04'39.16" |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-09-19 : 16:49:20
|
| you have to an INSERT INTO SELECT * FROM dbo.functionDinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
phrankbooth
Posting Yak Master
162 Posts |
Posted - 2007-09-19 : 16:53:38
|
Yes! Thanks.I just figured out you can do a select into a temp table.Why do I always come up with an answer right after I click submit? --PhB |
 |
|
|
|
|
|
|
|