April 30, 2008 at 12:01 pm
I have a very long SQL script for importing data. I have been trying to google how to execute a command in such that it run seperate to the currect execution.
eg.
exec importRaw
exec update-some-stuff <--I want this to run WHILE I'm importing from live and not wait for it to finish before starting the next import
exec importLive
April 30, 2008 at 12:27 pm
You have to do this from separate connections.
April 30, 2008 at 1:01 pm
Yep. TSQL is a scripting language. As such it's sequential. To launch a seperate "thread" you have to make a completely different connection and launch a script from there.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2008 at 2:38 pm
You could jury-rig something up through Service Broker or even a SQL Agent Job.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
April 30, 2008 at 7:19 pm
I wasn't thinking about it earlier, but you could just write the whole thing in SSIS. That will multi-thread very well.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply