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 |
|
nirene
Yak Posting Veteran
98 Posts |
Posted - 2008-09-26 : 11:25:43
|
| Hai All,Set SQLStr='Update ' + @Tbl + ' Set ' + @FldNm + '=''' + @Junk +''''Exec sp_executesql @SQLStrWhere @Tbl is my Table Name@FldNm - Field name@Junk - is the String VariableI dont no what I'm doing wrong,please solve this.Nirene |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-26 : 11:27:26
|
| use EXEC(@SQLStr). no need of sp_executesql here |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-26 : 11:28:11
|
What is your problem?Error?Wrong values?Nothing? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-26 : 11:36:45
|
quote: Originally posted by nirene Hai All,Set SQLStr='Update ' + @Tbl + ' Set ' + @FldNm + '=''' + @Junk +''''Exec sp_executesql @SQLStrWhere @Tbl is my Table Name@FldNm - Field name@Junk - is the String VariableI dont no what I'm doing wrong,please solve this.Nirene
SQLStr should be @SQLStrMadhivananFailing to plan is Planning to fail |
 |
|
|
nirene
Yak Posting Veteran
98 Posts |
Posted - 2008-09-26 : 11:50:47
|
| Thanks Madhivanan.I was breaking my head for the past 1/2 hour for this simple work.Thanks once again.Nirene |
 |
|
|
|
|
|