Posts

Showing posts with the label linked-server

Speeding up SQL transfer over a network

Image
Clash Royale CLAN TAG #URR8PPP Speeding up SQL transfer over a network I have two SQL environments, data warehouse which collects data and a datamart which people access for a subset of the data, each with their own SQL 2016 databases. I run a script which pulls out data, transforms it and transfer it from the data warehouse to the datamart using Linked Servers. The entire process takes around 60+ hours to run. I want to avoid at all costs at having the data warehouse data in the datamart. I experimented to see why the whole process was taking so long. I did a backup of the data warehouse, restored it onto the datamart and ran the import script and the entire process took around 3 hours to run. The script itself to 1.5 hours, telling me of the 60+ hours its the linked server transfer of data between the two servers that is the slowest part. I've pretty much ruled out network speed or issues between the two servers; this is all SQL. I'm trying to avoid having to write an applica...

SQL Job, Linked Server, Domain Account

Image
Clash Royale CLAN TAG #URR8PPP SQL Job, Linked Server, Domain Account I think I have tried everything but I can't figure out how to set up an SQL Job that have a T-SQL Step that performs a SELECT on a linked server. 1) I got a Domain user mydomainSQLJob 2) I got a SQL 2017 server 'JOBSERVER' with the SQL Agent running log on as a domain user mydomainsv_agent (this cannot be changed). No futher rights should be given to this user either. 3) On the JOBSERVER I created a linked server EXEC sp_addlinkedserver 'LINKEDSERVER' 4) mydomainSQLJob is data reader on a database on LINKEDSERVER 5) I am able to do a SELECT * FROM LINKEDSERVER... from JOBSERVER in a regular Query Window. On JOBSERVER I have tried ALTER DATABASE MyDatabase SET TRUSTWORTHY ON And then set the job to execute in MyDatabase I have also tried Job Step Properties > Advanced > Run as user > mydomainSQLJob I have tried adding mydomainSQLJob to the linked server on JOBSERVER both with and withou...