How to write text to a text file inside storeproc

  • Hi,

    Is there any way to write text to a text file inside storeproc besides using any DTS/CLR native library? Can I use some simple routines like PRINT/RAISEERROR for file logging?

    Thanks and regards,

    Wallace

  • there's not really a good way and, frankly, you shouldn't. TSQL is a great language for querying databases and manipulating data. It's quite horrible at all other tasks. I'd suggest raising an error and then letting whatever is calling the query handle the logging.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply