|
-
Jul 10th, 2007, 04:05 AM
#1
Thread Starter
Fanatic Member
Constructing an sql string
Hi, Im trying to build some sql through string concatenation can someone take a look, im having problems with quotes.
Code:
set @SQL = @SQL + 'CASE owner_ein '
set @SQL = @SQL + 'WHEN ''NA'' THEN ''Unassigned'' '
set @SQL = @SQL + 'else ''''<a target=''_blank'' href=''http://url?ein='' + ein + ''''>'' + LEFT(firstname, 1) + ''. '' + surname + ''</a>'' AS name'''
set @SQL = @SQL + 'END as name '
Its the third line im having trouble with.
-
Jul 10th, 2007, 08:51 AM
#2
Re: Constructing an sql string
Hi
I have copy and pasted query into Query Analiser for ms sql 2000 and no errors.
"The dark side clouds everything. Impossible to see the future is."
-
Jul 10th, 2007, 09:38 AM
#3
Thread Starter
Fanatic Member
Re: Constructing an sql string
thanks, but there were errors when calling the stored procedure from the web. I have sorted it now anyway, if anyones interested.
Code:
set @SQL = @SQL + 'else ''<a target="_blank" href="url?ein='' + ein + ''">'' + LEFT(firstname, 1) + ''. '' + surname + ''</a>'''
i didn't know you could use " in the string
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|