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 |
scmay
Starting Member
22 Posts |
Posted - 2007-02-02 : 00:09:45
|
Hi I am having errors updating a column in a database.SQL statement in store procedure>>SELECT @origUrno=OriginalUrno FROM ObTemp WHERE ConvertedUrno=@UrNo>>UPDATE ObAdmission SET UrNo=@origUrno WHERE UrNo=@UrNoSome of the data is incorrect while some are correct.If I use this>>UPDATE ObAdmission SET anotherColumnUrno=@origUrno WHERE UrNo=@UrNowhich is updating anotherColumnUrno rather than UrNo there are no errors. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-02 : 00:26:35
|
is ConvertedUrno the primary key ?"which is updating anotherColumnUrno rather than UrNo there are no errors."You mean there are error with your previous statement ?try thisupdate uset UrNo = OriginalUrnofrom ObAdmission u inner join ObTemp t on u.UrNo = t.ConvertedUrnowhere u.UrNo = @UrNo KH |
|
|
|
|
|