سؤال

OK, this SHOULD be fairly simple. I'm trying to INSERT some rows from DatabaseA.Sets to DatabaseB.Sets. I would think it would something like the following...

    INSERT INTO [DatabaseB].sets 
           (SetID,ParentID,title,version_number,OrganizationID,DateModified,DateDeleted,DateCreated,ModifiedByUserID,HighAbusePotential,TakeWithFood)
           SELECT SetID,ParentID,title,version_number,OrganizationID,DateModified,DateDeleted,DateCreated,ModifiedByUserID,HighAbusePotential,TakeWithFood
              FROM (select * from sets where setid in 
                       (select sd.setid 
                        from setdiseases sd left join diseases d on sd.diseaseid = d.diseaseid 
                        where sd.diseaseid = 86 or sd.diseaseid = 87)
           ) as thistable

This is all happening in a SQL database inside Azure.

Error I'm getting is: Invalid object name 'DatabaseB.sets'

هل كانت مفيدة؟

المحلول

You can't move data directly between multiple databases in Azure, even if they are tied to the same account. You might look into the SQL Data Sync tool. It's still in preview, but it would allow you to move the data as you're looking for. Either that or have some front end application or utility that will pull the data from one database and push it into the other one.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top