SP_OACreate issue

  • Whenever I run the following command it give me error like -2147023782

    but when I run on DOS prompt , I don't get an error.

    Declare @SQLCMD Varchar(500)

    Declare @OLEResult int

    Declare @ShellID int

    set @SQLCMD = 'SQLCMD -S SCDC312DB -E -Q "Execute [SSIS_FRAMEWORK].[dbo]. post_GW_Load_Master] 1665"'

    EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT

    print @OLERESULT

    get following error -2147023782

    Any help is appreciated.

  • Have you tried running it using xp_cmdshell, instead of trying to create a shell object?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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