Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 execution fail results in to a text file

Author  Topic 

Reddappa
Starting Member

9 Posts

Posted - 2012-02-13 : 05:25:28
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

52326 Posts

Posted - 2012-02-13 : 09:40:16
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

9 Posts

Posted - 2012-02-14 : 01:59:18
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

52326 Posts

Posted - 2012-02-14 : 09:41:04
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
   

- Advertisement -