question

sunithalee143 avatar image
sunithalee143 asked

updation error

hi all, i am trying to update a table in sql server 2005 by using command, but when i am executing then i am getting the error msg 156. can any one help me out in this regarding.
sql-server-2005
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mrs_Fatherjack avatar image Mrs_Fatherjack commented ·
Can you show the actual code you used please.
0 Likes 0 ·
BradleySQL avatar image
BradleySQL answered
Standard Syntax is UPDATE TABLE SET COLUMN_NAME = 'XXXX' WHERE CONDITION = 'YYYY'
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sunithalee143 avatar image sunithalee143 commented ·
i was using update table tablename which was throwing the error i used update tablename it worked. thanks
0 Likes 0 ·
Blackhawk-17 avatar image
Blackhawk-17 answered
Your best bet is to head to the source and check out the examples: [Books OnLine - UPDATE][1] [1]: http://msdn.microsoft.com/en-US/library/ms177523%28v=SQL.90%29.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
Sure looks like you're showing some type of ORM related set of code. XML like that is not standard SQL syntax. You'll need to troubleshoot this starting from your code. If you feel that's in hand, then you need to see what kind of TSQL your code is generating. Best way to do that is to fire up [SQL Profiler][1]. Do not run that on a production system though. [1]: http://msdn.microsoft.com/en-us/library/aa173918(v=SQL.80).aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.