| Author |
Topic |
|
Xerxes
Aged Yak Warrior
666 Posts |
Posted - 2005-02-14 : 15:47:36
|
I just can't see why this codeDECLARE @Tab_A table, TabID varchar(5), Tool varchar(13) DECLARE @Tab_B table, TabID varchar(5), Tool varchar(13)GOINSERT INTO @Tab_A SELECT 'Tab_A', 'Tire Iron ' UNIONSELECT 'Tab_A', 'Crowbar ' UNIONSELECT 'Tab_A', 'Monkey Wrench' INSERT INTO @Tab_B (TabID, Tool)SELECT 'Tab_B', 'Jackhammer ' UNIONSELECT 'Tab_B', 'Chainsaw ' UNIONSELECT 'Tab_B', 'Backhoe ' GOINSERT INTO @Tab_A SELECT TabID, ToolFROM @Tab_BGOSELECT * FROM @Tab_ASELECT * FROM @Tab_Bis giving me this:Server: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near ','.Server: Msg 170, Level 15, State 1, Line 2Line 2: Incorrect syntax near ','.Server: Msg 137, Level 15, State 2, Line 3Must declare the variable '@Tab_A'.Server: Msg 137, Level 15, State 1, Line 7Must declare the variable '@Tab_B'.Server: Msg 137, Level 15, State 2, Line 3Must declare the variable '@Tab_A'.Server: Msg 137, Level 15, State 1, Line 4Must declare the variable '@Tab_B'.Server: Msg 137, Level 15, State 2, Line 3Must declare the variable '@Tab_A'.Server: Msg 137, Level 15, State 1, Line 3Must declare the variable '@Tab_B'.I KNOW this has got to be something minor. I just don't see it.Please point me in the right direction, my compass is broke Semper fi, Xerxes, USMC(Ret.)-------------------------------------------------------------------------Once a Marine Programmer Analyst ALWAYS a Marine Programmer Analyst |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-02-14 : 15:50:17
|
| Since your tables are variables you don't want the GO statments.also:DECLARE @Tab_A table (TabID varchar(5), Tool varchar(13) )DECLARE @Tab_B table (TabID varchar(5), Tool varchar(13) )Be One with the OptimizerTG |
 |
|
|
Xerxes
Aged Yak Warrior
666 Posts |
Posted - 2005-02-14 : 15:56:20
|
This is what happens when I'm working with some complex code, then I need to run a Q&D on the SQA and it's ALWAYS something simple!A salute to you, TG! THANKS Semper fi, Xerxes, USMC(Ret.)-------------------------------------------------------------------------Once a Marine Programmer Analyst ALWAYS a Marine Programmer Analyst |
 |
|
|
|
|
|