April 21, 2006 at 3:34 am
Is there a function that generate excel files such as foxpro's?
April 21, 2006 at 4:44 am
No there isn't.
afaik there is no immediate way to generate 'real' excelfiles from T-SQL. There is a sort of workaround where you (using xp_cmdshell) when naming the output file use a .xls suffix. If I remember correctly, it does need some 'tweaking' when opened in Excel for the first time though.. (such as 'save as' in order to make it a 'true' Excelfile, and possibly something else, can't remember for sure.
/Kenneth
April 21, 2006 at 6:04 am
yeah.....you can very well create a csv format using...
bulk copy....."bcp exec spname parameters queryout filename -t -r\n -c -slocalhost -U(username) -P(password)"
the username and password shd b provided without braces..
and the above command runs from command prompt....
thatz it..
hope that helps...
Cheers
Riyaz
April 21, 2006 at 6:15 am
If the users of the file will always be "in-house", consider creating a spreadsheet that get's it's data from a stored procedure using a pass through query in External Data.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 25, 2006 at 2:04 pm
The quickest way is in query analyzer set the output to text and then hit CTRL - A (to select all) - CTRL C. Next open Excel and paste into Excel.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply