Move data accross SQL Servers with DTS packages or linked servers
By : user446909
Date : March 29 2020, 07:55 AM
Any of those help you can use BCP to export and then import data.
|
How to access Postgres data from SQL Server (linked servers)
By : Naren
Date : March 29 2020, 07:55 AM
this one helps. OPENQUERY is definitely a way to do it; what issues are you having with dynamic SQL? Perhaps create a temp table in server 1, import a filtered subset of the PostgreSQL data using a parameterized query into that temp table, and then join onto your temp table in your final SQL query.
|
How to create a table using the INSERT INTO clause using linked servers in SQL Server Management Studio
By : Sakshi
Date : March 29 2020, 07:55 AM
With these it helps There are two mistakes in your query 1.INTO clause support maximum of 2 prefixes. You cannot include SERVER NAME code :
DATABASE_NAME.SCHEMA_NAME.TABLE_NAME
SELECT *
INTO [Reporting].[dbo].[NewTable]
FROM [linked].[Main].[dbo].[Orders];
|
Test connection of linked servers and return connected linked server(s)
By : Dimitris T
Date : March 29 2020, 07:55 AM
Does that help Changed a few things in your code... give this a shot. IsOff just means the connection failed. I added a where clause to look at Linked Servers only I've never seen a cursor as a variable so I removed that and the other variables I didn't need Used a TRY/CATCH since sys.sp_testlinkedserver raises and exception if it doesn't success. Return the reason why it failed Stored all the results into a table variable and only returned the failures code :
DECLARE @name NVARCHAR(100)
declare @table table (IsOff int, ServerName varchar(100), TheError varchar(4000))
DECLARE getid CURSOR FOR
SELECT name FROM sys.servers where is_linked = 1
OPEN getid
FETCH NEXT FROM getid INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
begin try
exec sys.sp_testlinkedserver @name
end try
begin catch
insert into @table
values
(1,@name,ERROR_MESSAGE())
end catch
FETCH NEXT FROM getid INTO @name
END
CLOSE getid
DEALLOCATE getid
select ServerName, TheError from @table where IsOff = 1
|
How do you remove linked server metadata cache when there are no defined linked servers?
By : Adam W. P. Hackett
Date : March 29 2020, 07:55 AM
|