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 |
|
rudba
Constraint Violating Yak Guru
415 Posts |
Posted - 2009-05-15 : 11:34:24
|
| I have a table name tbl1, i have to update data on hlink field.the following script can not run, get error.Any body have solution?declare @tbl1 table (ID INT,hlink varchar(200))INSERT INTO @tbl1SELECT 1,nullINSERT INTO @tbl1SELECT 2,nullINSERT INTO @tbl1SELECT 3,nullINSERT INTO @tbl1SELECT 4,nulldeclare @val varchar(200)set @val='<a href="javascript:popup(''frmInfo.aspx?ID='+ convert(varchar,ID)+')">Abc</a>'update @tbl1 set hlink=@valselect * from @tbl1 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-05-15 : 11:54:34
|
| declare @tbl1 table (ID INT,hlink varchar(200))INSERT INTO @tbl1SELECT 1,nullINSERT INTO @tbl1SELECT 2,nullINSERT INTO @tbl1SELECT 3,nullINSERT INTO @tbl1SELECT 4,nulldeclare @val varchar(200) update @tbl1 set hlink='<a href="javascript:popup(''frmInfo.aspx?ID='+ convert(varchar(7),ID)+')">Abc</a>'Jim |
 |
|
|
rudba
Constraint Violating Yak Guru
415 Posts |
Posted - 2009-05-15 : 11:59:00
|
| I got following error:Msg 102, Level 15, State 1, Line 20Incorrect syntax near '='. |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-05-15 : 12:02:38
|
| It works for me, are you sure you got everything on the copy and paste?Jim |
 |
|
|
rudba
Constraint Violating Yak Guru
415 Posts |
Posted - 2009-05-15 : 12:06:57
|
| Oh ya, its work. Thanks a lot Jim |
 |
|
|
|
|
|
|
|