August 12, 2010 at 11:31 am
I have a stored procudre that returns around 100,000 records and I would like to export that recordset to excel anytime this stored procedure is ran. Is there a way that I can achieve this. Thank you.
August 12, 2010 at 12:28 pm
Depends on the version of excel you intend to open the file in.
http://msdn.microsoft.com/en-us/library/aa730921(office.12).aspx#Office2007excelPerf_BigGridIncreasedLimitsExcel
August 12, 2010 at 12:31 pm
I would never hit the 1 million row count limit. I am just trying to find a way to export this data to excel or .csv. Thanks
August 12, 2010 at 1:31 pm
You can use xp_cmdshell and bcp.
More information here:
http://msdn.microsoft.com/en-us/library/ms162802.aspx
In your case fora csv, you'll specify that the -t (field term) will be a comma, which it'll add that in for you.
August 13, 2010 at 4:43 am
You should use MS excel 2007 version or higher to support 1,00,000 rows. Since Ms excel 2003 has the limit of 65536 rows by 256 columns.
In excel 2007 the limit is increased to 1,048,576 rows by 16,384 columns.
You can use an SSIS package to transfer stored proc result set to excel.
Thanks,
Amit Kulkarni
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply