Link to home
Start Free TrialLog in
Avatar of bmanmike39
bmanmike39

asked on

I have a select query that I would like to add string data to

I would like to have my query return the following

SELECT  dirID, name, email,  http://www.details.aspx?dirID={ + dirID + } AS qs
FROM  directors

I get an error when I try this.  How can I create this http query string as a result in my query?

Sample of the query Im trying to create

http://www.details.aspx?dirID={0}
ASKER CERTIFIED SOLUTION
Avatar of lof
lof
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bmanmike39
bmanmike39

ASKER

This is what i have I still got an error.

I used single and double quotation marks

SELECT  dirID,  email,  '"http://www.details.aspx?dirID={'" + convert(varchar(max),dirID) + '"}'" AS qs
FROM  directors
just convert the dirID to varchar and then append it to the string.



SELECT  dirID, name, email,  'http://www.details.aspx?dirID={' + CAST(dirID AS varchar) + '}' AS qs
FROM  directors
try my post as given
Thanks  it works , fond a typo first time i ran it.
You need to use single quotation marks in SQL, double ones are meaningless