Home > Archive > MS SQL Server > February 2006 > Executing Store Proc BCP Statement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Executing Store Proc BCP Statement
Jaydip Das

2006-02-10, 7:23 am

I have a store procedure and I want that result of that procedure
queryout to a excel sheet.

like


bcp "DatabaseName.Owner.Procedure_name" queryout
"C:\Folder\testproc.xls" -c -q -S"ServerName" -T

Is it possible??

*** Sent via Developersdex http://www.droptable.com ***
Tibor Karaszi

2006-02-10, 7:23 am

Use can use xp_cmdshell to call BCP from your stored procedure.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"Jaydip Das" <jaydip_j@hotmail.com> wrote in message news:Ok8VZeiLGHA.1676@TK2MSFTNGP09.phx.gbl...
>I have a store procedure and I want that result of that procedure
> queryout to a excel sheet.
>
> like
>
>
> bcp "DatabaseName.Owner.Procedure_name" queryout
> "C:\Folder\testproc.xls" -c -q -S"ServerName" -T
>
> Is it possible??
>
> *** Sent via Developersdex http://www.droptable.com ***

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com