Syntax in LoadFromSQLServer method

  • Hello,

    I'm trying to pass a parameter into the above referenced method. But the switching between VBA and T-SQL syntax is vexing me.

    CREATE PROCEDURE spRun_DTS (@PackageName char(10))

    AS

    DECLARE @object int, @hr int

    DECLARE @src varchar(255), @desc varchar(255)

    EXEC @hr = sp_OAMethod @object, 'LoadFromSQLServer("OWS78002878791", "", "", 256, , , , & @PackageName & )'

    If I hard code a value instead of @PackageName, then it works just fine. Any ideas?

    Thanks

  • Hi

    You have to use dynamic sql for this .

    "Keep Trying"

Viewing 2 posts - 1 through 1 (of 1 total)

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