How to get Batch file error Message

  • Hi All,

    I am using Batch file

    In batch file it consists of sqlcmd firing stored procedure getting output to file..

    but my question is

    If i get any error that should be popped out (eg ; if i am passing wrong parameter to procedure then error sholud be poped out in command promt only not to text file)

  • Are you using xp_cmdshell to execute your BAT file?

    SNM

    Try Free Microsoft SQL Server Data Collector & Performance Monitor.

    http://www.analyticsperformance.com[/url]

    @nalyticsperformance - Microsoft SQL Server & Windows Server Free Data Collector

  • HI ,

    I am not using Xp_cmdshell

    i am runnbing batch file from command prompt

    My batch file name : run .bat

    running from cmd eg : run.bat,@date,@file name

    i am getting output to file ..

    but if the user passes wrong date in @date parameter at command prompt

    the it should echo the message "enter the proper date"

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

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