I need the syntax for using the sp_XPCommand .....

  • The following just works fine at the command prompt.

    osql -E -S "SERVER.edu" -d "DBNAME" -i "E:\ACRC443\event_echo_1\event_echo_ins_1_1.sql"

    However can someone help me with the syntax so that I can run directly from SSMS please ?

  • See MS article:

    https://msdn.microsoft.com/en-us/library/ms175046.aspx

    What are you trying to achieve?

  • You need these options on to use xp_cmdshell

    EXEC sp_configure 'show advanced options', 1

    RECONFIGURE

    EXEC sp_configure 'xp_cmdshell', 1

    RECONFIGURE

    EXEC xp_cmdshell 'osql -E -S "SERVER.edu" -d "DBNAME" -i "E:\ACRC443\event_echo_1\event_echo_ins_1_1.sql" '

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

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