Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sbuser
Starting Member
6 Posts |
Posted - 2007-11-12 : 10:41:39
|
| I am running an insert in a stored procedure, but need tio concatenate on of the fields. How do I do that? Below is an example: INSERT sam.dbo.product ( productName, ProdDesc, TransDateBegin, TransDateEnd )SELECT Code, Description + 'the product is displayed' + <br><br>'To purchase this <a href=/purchaseitem.aspx?' >here</a>FROM web.dbo.order_codes AS OCWHERE productName = codeAny ideas how I can get the select statement working?SB |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-12 : 10:45:29
|
quote: Originally posted by sbuser I am running an insert in a stored procedure, but need tio concatenate on of the fields. How do I do that? Below is an example: INSERT sam.dbo.product ( productName, ProdDesc, TransDateBegin, TransDateEnd )SELECT Code, Description + ' the product is displayed <br><br>To purchase this <a href=''/purchaseitem.aspx?''>here</a>'FROM web.dbo.order_codes AS OCWHERE productName = codeAny ideas how I can get the select statement working?SB
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
anonymous1
Posting Yak Master
185 Posts |
Posted - 2007-11-12 : 10:47:11
|
| looks like you quotes are out of place, have you tried this...SELECT Code, Description + 'the product is displayed<br><br>To purchase this <a href="/purchaseitem.aspx?">here</a>'FROM web.dbo.order_codes AS OCWHERE productName = codeusually it is best to let the web page handle adding tags and the like |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-13 : 02:48:14
|
| <<usually it is best to let the web page handle adding tags and the like>>yes it should be best handled at web pageMadhivananFailing to plan is Planning to fail |
 |
|
|
arorarahul.0688
Posting Yak Master
125 Posts |
Posted - 2007-11-13 : 04:19:13
|
quote: Originally posted by anonymous1 looks like you quotes are out of place, have you tried this...SELECT Code, Description + 'the product is displayed<br><br>To purchase this <a href="/purchaseitem.aspx?">here</a>'FROM web.dbo.order_codes AS OCWHERE productName = codeusually it is best to let the web page handle adding tags and the like
it will not work using HTML tags in sql query willl generate error of incorrect syntaxtry to use nchar or unicode string functions that may workRahul Arora MCA 07 BatchNCCE Israna, PanipatHRY, INDIA######################IMPOSSIBLE = I+M+POSSIBLE |
 |
|
|
|
|
|
|
|