Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to get data from 2 database

-- Fetch data from the other database server
SELECT *
INTO #myTempTable
FROM OPENQUERY([DB2], 'SELECT * FROM [MyDatabaseOnDB2].[dbo].[MyOtherTable]')

-- Now I can join my temp table to see the data
SELECT * FROM [MyDatabaseOnDB1].[dbo].[MyTable] tab1
    INNER JOIN #myTempTable tab2 ON tab1.ID = tab2.ID
Comment

PREVIOUS NEXT
Code Example
Sql :: select a row include list of array with join table SQL 
Sql :: sqlite closes value 
Sql :: hex string sql becomes int64 
Sql :: can we compare two timestamps in mysql 
Sql :: how to restart postgres server on windows 
Sql :: SQL LEFT JOIN With AS Alias 
Sql :: sqlite escape single quote 
Sql :: MySQL - How to find word with the most similar beginning 
Sql :: select between dates opstgres 
Sql :: Failed to initialize, mariadb service is unhealthy. 
Sql :: TSQL select 50 records at a time 
Sql :: db visualizer mssql 
Sql :: sql int ++ 
Sql :: MSSQL MAX VALOR 
Sql :: hibernate xml property MySQL url, username and password 
Sql :: Object Information 
Sql :: mysql create user if not exists 
Sql :: dbname+tablename 
Sql :: employee name starting with in sql 
Sql :: psql 
Sql :: ora 00001 error catch plsql 
Sql :: python and mysql connectivity 
Sql :: connect to remote mysql server 
Sql :: mysql order by calculated column 
Sql :: finding leap year in sql 
Sql :: mysql match in serialized data 
Sql :: add colum in sql 
Csharp :: c# calcualte proccess 
Csharp :: unity float from another script 
Csharp :: how to index ireadonlycollection c# 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =