Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing query output to a text file

Status
Not open for further replies.

Tomi

Programmer
Nov 19, 2001
57
US
Is there any function or command in TSQL to check for the filesize. ?
I need to write the output of a query continuously to a file with filename qryout_200505120150200( timestamp)
and when the file reaches say 100 mb it should create another file with the timestamp
Are there any scripts available ?

Thanks
Tomi
 
xp_getfiledetails lists the file details for a file, the following fields are returned
Alternate Name,Size,Creation Date, Creation, Time Last Written, Date Last Written, Time Last Accessed,
Date Last Accessed Time and Attributes

exec master..xp_getfiledetails 'C:\qryout_200505120150200.txt'

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Thank you , Is it possible to create the file , so that a new file is created when the system date changes and filename indicating the date and time also ?

Tomi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top