SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
$$ Marco Problem

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
$$ Marco Problem
Author Message
neverden



Joined: 02 Dec 2008
Posts: 58

Post $$ Marco Problem Reply with quote
I am using beta 5 but I don't think this is a beta issue. I am trying to make a simple snippet using a $$ marco. My end goal is to have $$COLUMS$$ return them all in one line. However here is my first step:

$OBJECT$
$$
declare @cols varchar(max)
set @cols = '$COLUMNS$'
select @cols
$$

and I get this error:
Msg 102, Level 15, State 1, Incorrect syntax near ','.
Fri Apr 16, 2010 8:32 am View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Re: $$ Marco Problem Reply with quote
Have you tried following the $MARCO$ with the $POLO$ keyword? :) Then everything not included in the results is found in $FISH OUT OF WATER$ Your results may vary.
Fri Apr 16, 2010 9:50 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Please enter 1 space between quote and $COLUMNS$ macro. Without a space separator it uses adjacent text as prefixes for each value in the generated list

Code:
$OBJECT$
$$
declare @cols varchar(2000)
set @cols = ' $COLUMNS$ '
select @cols
$$


You may also choose to move $OBJECT$ macro after or inside $$ … $$ to avoid table name being inserted above the columns
Fri Apr 16, 2010 9:59 am View user's profile Send private message
neverden



Joined: 02 Dec 2008
Posts: 58

Post Reply with quote
worked, thanks!
Fri Apr 16, 2010 2:09 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.