fork a process

  • 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.

  • 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


    - Craig Farrell

    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

  • no, go would nuke my variables

  • 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.


    - Craig Farrell

    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

  • 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

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply