XP_CMDSHELL

  • Hi,

    I am trying with tablediff.

    the below command I am trying in T-SQL. but it is not giving the output file. ( But it works fine in dos prompt).

    DECLARE @sTableDiff nvarchar(1000)

    SET @sTableDiff= '"C:\Program Files\Microsoft SQL Server\100\COM\tablediff"' + ' -sourceserver WXP-6SKY3BS -sourceuser sa -sourcepassword sqlsa -sourcedatabase AdventureWorks -sourceschema sales -sourcetable SalesOrderDetail -destinationserver WXP-6SKY3BS -destinationuser sa -destinationpassword sqlsa -destinationdatabase AdventureWorks_copy -destinationschema sales -destinationtable SalesOrderDetail -f c:\ff\chan.txt'

    EXEC XP_CMDSHELL @sTableDiff

    Can some one help me in this regard ?

    ( I enable the option and other test commands are working fine with XP_CMDSHELL )

  • can u specify the error u r getting?

    Sanket Ahir
    Don't run behind the success, Try to be eligible & success will run behind u......

  • No Error ... no Output file in the destination.

    but the dos method creating a file.

  • Try scheduling it as a job and see it it creates file.

    MJ

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

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