June 11, 2008 at 7:54 pm
I did defined variable properly, what am i doing wrong on following code. I am trying to change file name dynamically
'Create Table' + @[User::newfile] (
[First] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Middle] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[last] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[number] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[street] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
June 11, 2008 at 8:49 pm
The second part is not in quotes.
'Create Table' + @[User::newfile] + '(
[First] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Middle] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[last] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[number] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[street] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]'
June 12, 2008 at 5:58 am
when i tried to parse. Is still says incorrect sysntax near 'create table'
June 12, 2008 at 7:31 am
Hi, replace the singe quote with double quote. The code in the expression box should be like this ....
" "Create Table" + @[User::newfile] + "(
[First] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Middle] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[last] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[number] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[street] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]" "
This should work.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply