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.
| Author |
Topic |
|
CanadaDBA
583 Posts |
Posted - 2005-01-31 : 14:37:00
|
| I'm going to create a stored procedure that checks for a text file. If it exists, appends a line to it. If id doesn't exist, creates it and appends the line to it. What commands are the most useful one?Canada DBA |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-01-31 : 14:59:52
|
| xp_cmdshell?seehttp://www.mindsdoor.net/SQLTsql/WriteTextFile.htmlhttp://www.mindsdoor.net/SQLTsql/CheckIfFileExists.html==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-01-31 : 23:46:46
|
You might try the undocumented stored procedure, xp_fileexist.More info at:[url]http://www.sql-server-performance.com/ac_extended_stored_procedures.asp[/url]-- Example & result setexec master.dbo.xp_fileexist 'c:\boot.ini'File Exists File is a Directory Parent Directory Exists ----------- ------------------- ----------------------- 1 0 1 quote: Originally posted by farhadr I'm going to create a stored procedure that checks for a text file. If it exists, appends a line to it. If id doesn't exist, creates it and appends the line to it. What commands are the most useful one?Canada DBA
Codo Ergo Sum |
 |
|
|
CanadaDBA
583 Posts |
Posted - 2005-02-01 : 10:00:28
|
| Thank you both for great replies. I appreciate your time.Canada DBA |
 |
|
|
|
|
|