February 23, 2011 at 7:16 am
I have the following string.
http://tgl.test.com/plc/login/confirm.asp?c=1&ftr=0&lvert=12344&r=0&email=test@test.com
I want to generate the following string with diff values for c,ftr,lvert,r and email from the database.
I have 10000 records in the database for the above values.
I want to generate 10000 URLs with the values in the database table.
How can I do this?
Thanks in advance.
February 23, 2011 at 7:22 am
Are those values stored in the database? Are they in one table or multiple tables? Are they stored as strings (varchar/nvarchar/char/nchar datatypes)? Are you building the string in the query, or querying the values and building the string in a higher layer?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 23, 2011 at 7:24 am
you'd need a lot more details to get a more refined answer, but offhand, this might get you started:
SELECT
'http://tgl.test.com/plc/login/confirm.asp?'
+ 'c=' + CONVERT(varchar,ColumnRepresenting_c)
+ '&ftr=' + CONVERT(varchar,ColumnRepresenting_ftr)
+ '&lvert=' + CONVERT(varchar,ColumnRepresenting_lvert)
+ '&r=' + CONVERT(varchar,ColumnRepresenting_r)
+ '&email=' + CONVERT(varchar,ColumnRepresenting_email)
FROM YourTable
Lowell
February 23, 2011 at 7:25 am
All those values are stored in one database table and some of them are integers and some are varchar and I am building this string in a sql query to generate 10000 strings.
Thanks.
February 23, 2011 at 8:53 am
Thanks Lowell. It worked great.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply