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? CanadaDBA
xp_cmdshell. if you want to interact with OS files it'll be required. that or DTS. Tom Pullen DBA, Oxfam GB
Thanks for both replies. Specially, the "Echo" idea works fine! It creates the file if it does not exist and appends to file if it exists. Exactly, what I was looking for. Just for my knowledge, do we have commands in T-SQL that we can check for files or do the above with those commands. I will use the command shell and Echo but I am just curious. CanadaDBA
there are extended stored procs that do this, e.g xp_fileexist .. or you can do it using xp_cmdshell manually. there are also XPs that do stuff like read the registry. Tom Pullen DBA, Oxfam GB