0

I need to identify fields in tbl_1 (2+ x 10^6 rows) in db_1 that do not match what is supposed to be the same field in tbl_2 in db_2 and insert an error log record in a tbl_3 in db_1 when a mismatch is found. Azure SQL Server does not allow me to "FROM" tbl_2 in db_2. It barfs on "db_2.dbo.tbl_2". Is this not possible in Azure SQL Server?

Error message: Msg 40515, Level 15, State 1, Line 16 Reference to database and/or server name in 'dbCaseMgmtSystemData.dbo.CM_CASE_DOCKET' is not supported in this version of SQL Server.

merb
  • 3
  • 2
  • 1
    This should not be a mind-reading exercise. If you encounter an error, post the complete error message. All of it - including severity, number, etc. That suggestion applies to any question you may ask in any technical forum. – SMor Oct 21 '20 at 01:53
  • Does this answer your question? [Cross database queries.How to proper use cross database features?](https://stackoverflow.com/questions/61122625/cross-database-queries-how-to-proper-use-cross-database-features) – SMor Oct 21 '20 at 01:53
  • error message added (my bad!) – merb Oct 21 '20 at 13:23

1 Answers1

0

Cross-Database Queries is supported in Azure SQL. This document explains how to do that. You can query tbl_2 in db_2 and insert into tables in db_1. You need to define a stored procedure to implement your processing logic.

Dale K
  • 25,246
  • 15
  • 42
  • 71
Joseph Xu
  • 5,607
  • 2
  • 5
  • 15