Home > Archive > MS SQL Server > November 2006 > How to run windows DOS command in SQL?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to run windows DOS command in SQL?
jsheldon via SQLMonster.com

2006-11-09, 7:13 pm

I want to check to see if any error files from SQL uploads are present in a
folder.

I want to run IF EXISTS *.err then run EXEC xp_sendmail stored procedure


How can I check a windows directory for *.err files in SQL syntax? osql?

--
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Fo...server/200611/1

Arnie Rowland

2006-11-09, 7:13 pm

There is an 'undocumented' function that will do that for you
[xp_fileexist]. See this article:

Functions -UnDocumented Check to Verify File Existence
http://www.sqlservercentral.com/col...xpfileexist.asp


--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous

You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf


"jsheldon via webservertalk.com" <u2880@uwe> wrote in message
news:6909a192e8dbf@u
we...
>I want to check to see if any error files from SQL uploads are present in a
> folder.
>
> I want to run IF EXISTS *.err then run EXEC xp_sendmail stored procedure
>
>
> How can I check a windows directory for *.err files in SQL syntax? osql?
>
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Fo...server/200611/1
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com