Posts

Showing posts from January, 2017

Azure sp_execute_remote / Cross Database query in Sql Azure.

Cross database query is not allowed in Sql Azure. Rather Azure has applied a different logic to use the same. Please check my article before proceeding with "sp_execute_remote " http://an-it-solution.blogspot.in/2017/01/sql-azure-select-from-another-database.html You need to create a SP in " DbCustomers"  with the name of " LogEvents_Insert" which will be called by following query. The below query will execute in " DbPayments  " and insert data into "LogLogin" of " DbCustomers" EXEC sp_execute_remote @data_source_name  = N' DbUtilityLogging_Datasource ', @stmt = N'LogEvents_Insert @LoginID', @params = N'@LoginId nvarchar(50)', @LoginID='narender90'

Sql azure select from another database / Cross Database connection

Cross database query Sql Azure Azure cross database query performance sql azure select from another database reference to database and/or server name in is not supported in this version of sql server. All the above statements are reference to the issue we face while shifting data from Sql Server to Azure Database. While using Sql Server (Any version) we can reference any database with in Sql server according to user rights assigned to user. We can use statements like "select * from db1.dbo.customers" But now in Sql Azure the system and terminology has changed. Now, azure has new concept of External Tables  and sp_execute_remote  in introduced. Now we need to know the who is who in Azure. External Tables = "Is for Select" sp_execute_remote="Execute External Store Procedures" Before proceeding. Please create 2 azure databases as per your choice. Here I am naming them as. DbCustomers and DbPayments  and keep a reference to them ...