Amit writes "What is the exact syntax for storing output of a Stored Procedure or a query in a text file. I was trying bcp utility, but is giving error. Thanks in anticipation"
About the best you can do in SQL 7 is to use CSV's to impersonate Arrays. Your best bet is to use a temp table. They are as close as you can get and really fast.
They probably didn't have it in SQL Server 7, but BCP has a "QUERYOUT" feature in 2k and above.
--Jeff Moden"Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! " "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row" For better, quicker answers, click on the following... http://www.sqlservercentral.com/articles/Best Practices/61537/