Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update concatenation records in sql server 2005 1

Status
Not open for further replies.

macsql1

Programmer
Jan 20, 2008
25
IN
Good Morning,

Using SQL server 2005. I have 200 records and want to update ALL field with URL along with GUID where GUID is unique for every record

Here '<a href= constant and would like to insert GUID dynamically, also {GUID} varies for each records.

Table Groupone
---
Grouponeid (pk,uniqueidentifier,not null)
gfieldone (nvarchar(250),null)
datemodifiedon(datetime,null)

Kindly let me know where i am missing.

update Groupone
set gfieldone = '<a href=from Groupone
where
datemodifiedon>'01-23-2009'

thank in advance

mac
 
Try this:

Code:
update Groupone
set gfieldone = '<a href=[URL unfurl="true"]https://testlog.com/main.aspx?id={'+Convert(VarChar(50),[/URL] Grouponeid) +'}>GroupOne</a>'
from Groupone
where
datemodifiedon>'01-23-2009'

In the future, I would encourage you to indicate what the error message is. It really does help a lot.

In this case, the error message should have been:

[red]The data types varchar and uniqueidentifier are incompatible in the add operator.[/red]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top