February 26, 2015 at 1:02 pm
It might be an old question but wanted to see, if we have any latest techniques (other than bcp).
SELECT Field1, Field2 FROM MyTable
If I want to export the output of the above query to a csv on a network folder, what would you suggest? I would like to avoid usage of SSIS package or BCP (as user needs to get additional rights to execute bcp)
Thanks
February 26, 2015 at 1:22 pm
the end user is going to be using TSQL to send files to disk, or is this some sort of automated process that you are envisioning?
in my case, i have a suite of CLR stored procedures that do a lot of exporting to disk for various formats, and then a classic example would be a signed procedure that a normal user can call, that sends a query to the CLR, which creates the file, which can then either be emailed or browsed to if it was copied to a share the user has access to.
Lowell
February 26, 2015 at 1:48 pm
I'm planning to create a stored procedure which dumps to a file in the specified path. It will be scheduled as job on the server.
February 26, 2015 at 1:53 pm
Right now, I have created SP and used sqlcmd to dump to file. But, when I open in text file, it shows up lots of empty space as it takes some width on each column like below.
"Text1" ,"Text2"
"ttt" ,"T"
I'm still not sure if this is the best way!!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply