I need an asp classic script and the stored procedure associated with it to write a csv file that pulls information to a database and provides the user with a download link.
A code snippet that seems to work for extracting the data is:
exec master..xp_cmdshell 'bcp "SELECT * FROM [login to view URL] WHERE id = 1" queryout c:\[login to view URL] -c -t, -T -S'
The parameter that will need to change is the ID.
I am very new to ASP classic and MSSQL so will need detailed instructions on how to add the stored procedure.
Also we currently have a script that goes in and pulls the data to write line by line to CSV, but because of the large amounts of data in this database it bogs down our SQLs servers CPU usage and creates errors for other connections.
Thanks