November 10, 2010 at 1:49 pm
Does anyone have a cool idea how to for a process in sql other than using a job or xp_cmdshell?
e.g. from proc1 you spawn a call to proc2 and another one to proc3.
November 10, 2010 at 2:02 pm
Um, you mean something like:
CREATE PROC Proc1 AS
SELECT 'Proc1' AS Procname
GO
CREATE PROC Proc2 AS
SELECT 'Proc2' AS ProcName
EXEC Proc1
GO
EXEC Proc2
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
November 10, 2010 at 2:05 pm
no, go would nuke my variables
November 10, 2010 at 2:12 pm
The GOs are just there to build the CREATE PROCs.
The key is that Proc2 calls Proc1, which like any proc could be fed parameters and the like.
You'll have to be a lot more specific as to what you're looking for if that mini-code didn't help it make sense for what you're looking to do.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
November 10, 2010 at 4:30 pm
You could use a trigger on a custom table built to allow it to fire off other procs with params.
That's not especially easy or clean, but it will work.
It's difficult to get an async run of a separate proc from within a proc.
Scott Pletcher, SQL Server MVP 2008-2010
November 11, 2010 at 12:22 am
Service broker. Async messaging.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply