SQL Help.

04/05/2013 10:47 DirtyMind#1
By a mistake I f*cked up my IDs in coloumn Link in refobjcommon. What I need is this : A query which will take all IDs from the original back up of the database ( I have it restored under the SRO_VT_SHARD name) and put them in my new db with condition which says : replace all ids until u reach ID (coloumn name ID) 42000 (example). That's all I hope you get it. Thanks in advance!
04/05/2013 13:19 IceAmStiel#2
Code:
UPDATE dbo._RefObjCommon
SET Link = r2.Link
FROM dbo._RefObjCommon r1
JOIN Backup.dbo._RefObjCommon r2 on r1.ID = r2.ID
WHERE r1.ID <= 42000
04/05/2013 17:06 DirtyMind#3
[Only registered and activated users can see links. Click Here To Register...]

:(
[Only registered and activated users can see links. Click Here To Register...]
04/05/2013 19:45 IceAmStiel#4
Are you sure that your backup contains all valid Links?
04/05/2013 21:08 DirtyMind#5
Quote:
Originally Posted by IceAmStiel View Post
Are you sure that your backup contains all valid Links?
The query worked the problem is that it made the rest of the things with Link 0 ... before that they were okay but now I think I have to rebuild them on the hard way if there is no other way :/
04/05/2013 21:33 IceAmStiel#6
"the rest" I thought it's a backup lol