Register for your free account! | Forgot your password?

You last visited: Today at 19:47

  • Please register to post and access all features, it's quick, easy and FREE!


SQL Help.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2011
Posts: 133
Received Thanks: 44
SQL Help.

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!



DirtyMind is offline  
Old 04/05/2013, 13:19   #2
 
elite*gold: 0
Join Date: Jul 2011
Posts: 1,058
Received Thanks: 1,106
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


IceAmStiel is offline  
Thanks
2 Users
Old 04/05/2013, 17:06   #3
 
elite*gold: 0
Join Date: Nov 2011
Posts: 133
Received Thanks: 44



epvpImg: segami <- images spelled backwards, cool huh?
DirtyMind is offline  
Old 04/05/2013, 19:45   #4
 
elite*gold: 0
Join Date: Jul 2011
Posts: 1,058
Received Thanks: 1,106
Are you sure that your backup contains all valid Links?


IceAmStiel is offline  
Old 04/05/2013, 21:08   #5
 
elite*gold: 0
Join Date: Nov 2011
Posts: 133
Received Thanks: 44
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 :/
DirtyMind is offline  
Old 04/05/2013, 21:33   #6
 
elite*gold: 0
Join Date: Jul 2011
Posts: 1,058
Received Thanks: 1,106
"the rest" I thought it's a backup lol


IceAmStiel is offline  
Reply



« Vsro FW & moving speed 500% | How to fix WHITE map error, NO IMAGE item (SQL 2208 r2) »



All times are GMT +2. The time now is 19:47.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.