SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 execution fail results in to a text file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Reddappa
Starting Member

India
9 Posts

Posted - 02/13/2012 :  05:25:28  Show Profile  Reply with Quote
Hi ,
i am executing my insert statements from .sql file
ex:C:\Program Files\Microsoft SQL Server\90\tools\binn\osql.exe /S HostName\InstanceName /U xx /P xxxx /iD:InsertDB.sql

InsertDB.sql file having 5 insert statements,suppose if any one of the statement is failed how i can know that result.
i want to see that result through text file . is it possible?

thanks in advance.


fdfsd

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 02/13/2012 :  09:40:16  Show Profile  Reply with Quote
use TRY...CATCH and log the results to table to see which all inserts failed

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Reddappa
Starting Member

India
9 Posts

Posted - 02/14/2012 :  01:59:18  Show Profile  Reply with Quote
Hi visak,
thanks for your replay, my problem is solved with :error command,
could you help me how to append one text file to another text file.is it possible through commands?

Thanks in advance.

fdfsd

fdfsd
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 02/14/2012 :  09:41:04  Show Profile  Reply with Quote
quote:
Originally posted by Reddappa

Hi visak,
thanks for your replay, my problem is solved with :error command,
could you help me how to append one text file to another text file.is it possible through commands?

Thanks in advance.

fdfsd

fdfsd


you mean through sqlcmd line commands?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000