[font="Arial"]
Hello,
Your post is some what criptic.
If I understand correctly, you want to have a sproc create dynamic SQL into an output file with the extention of .sql on the client machine and not the server.
If this is what you are asking, you can do it by creating a .bat command file on the client's machine. Then within the .bat have osql call a stored procedure that will build the dyanamic sql statement you want built. Have the sproc store the sql as text in a table. Then use bcp to output the sql statement to yoursproc.sql by reading the sql text.
Let me know if this is not clearly stated.
Regards,
Terry
[/font]