Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to get Batch file error Message Expand / Collapse
Author
Message
Posted Wednesday, November 25, 2009 10:45 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: 2 days ago @ 2:30 AM
Points: 23, Visits: 685
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)




Post #824792
Posted Friday, November 27, 2009 2:44 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, December 2, 2009 2:07 PM
Points: 70, Visits: 32
Are you using xp_cmdshell to execute your BAT file?



SNM

Try Free Microsoft SQL Server Data Collector & Performance Monitor.

http://www.analyticsperformance.com

@nalyticsperformance - Microsoft SQL Server & Windows Server Free Data Collector
Post #825763
Posted Monday, November 30, 2009 5:34 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: 2 days ago @ 2:30 AM
Points: 23, Visits: 685
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"



Post #826133
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse