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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-03-14 : 08:32:55
|
| moni writes "I have a question on the UPDATE query...this query is not workingupdate TABLENAME1 set PARAM1='SELECT * FROM TABLE2 WHERE PARAM2='XYZ' and PARAM3=PARAM4'and PARAM1 is a varchar in the table structure.This query is not working as we have 'SELECT and inside that PARAM2='XYZWhat is the best way to get rid of the error !! thanks for any response." |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-14 : 08:34:41
|
replace ' with ''Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-03-14 : 08:45:37
|
| Try thisupdate TABLENAME1 set PARAM1=(SELECT PARAM1 FROM TABLE2 WHERE PARAM2='XYZ' and PARAM3=PARAM4)MadhivananFailing to plan is Planning to fail |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-14 : 08:49:11
|
i think she wants to store select statements into the column Param1...Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-03-14 : 09:01:59
|
quote: Originally posted by spirit1 i think she wants to store select statements into the column Param1...Go with the flow & have fun! Else fight the flow 
If so,update TABLENAME1 set PARAM1='SELECT * FROM TABLE2 WHERE PARAM2=''XYZ'' and PARAM3=PARAM4'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|