Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 General Discussion
»
copy the select results into text file
11 posts, Page 1 of 2
1
2
»»
copy the select results into text file
Rate Topic
Display Mode
Topic Options
Author
Message
purushotham.k9
purushotham.k9
Posted Wednesday, June 09, 2010 9:52 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, December 08, 2010 7:22 AM
Points: 46,
Visits: 107
Post #934718
Lowell
Lowell
Posted Wednesday, June 09, 2010 9:58 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 3:50 PM
Points: 11,645,
Visits: 27,735
if you use an enhanced text editor like EditPlus,NotePad++,UltraEdit or one of many others, you can do it in a couple of seconds flat:
copy and pasting from grid view of SSMS gives you
tab
delimited results.
then you can find and replace the regular expression \t for tab with the pipe charcter and you are done.
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #934725
purushotham.k9
purushotham.k9
Posted Wednesday, June 09, 2010 10:00 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, December 08, 2010 7:22 AM
Points: 46,
Visits: 107
Actually i am selecting the data in stored procedure. from stored procedure it self i need to upload the data into text file with | delimeter
Post #934726
Lowell
Lowell
Posted Wednesday, June 09, 2010 10:05 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 3:50 PM
Points: 11,645,
Visits: 27,735
purushotham.k9 (6/9/2010)
Actually i am selecting the data in stored procedure. from stored procedure it self i need to upload the data into text file with | delimeter
In that case, look at either a CLR or xp_cmdshell calling bcp;
bcp has the ability to select a different delimiter when exporting.
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #934731
WayneS
WayneS
Posted Wednesday, June 09, 2010 10:54 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 9:12 AM
Points: 6,370,
Visits: 8,235
I'm not sure what you're after:
1. Are you running the procedure from SSMS, and you want to put the results into a text file with this delimiter?
2. Or do you want the procedure to put the results into a text file with this delimiter?
Either one is relatively easy, but to give the correct answer, we need to know exactly what you are doing.
Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then
DON'T USE IT
on a production system! After all,
you
will be the one supporting it!
Links:
For better assistance in answering your questions
,
How to ask a question
,
Performance Problems
,
Common date/time routines
,
CROSS-TABS and PIVOT tables Part 1
&
Part 2
,
Using APPLY Part 1
&
Part 2
,
Splitting Delimited Strings
Post #934775
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Wednesday, June 09, 2010 11:06 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 4:46 PM
Points: 31,433,
Visits: 13,745
It would help if you explained how you are getting this data, show some code, and then explain what will happen. As Wayne mentioned, there are ways to do this, it would help if you stopped, thought about what you are doing, and then provide more information.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #934789
purushotham.k9
purushotham.k9
Posted Thursday, June 10, 2010 3:09 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, December 08, 2010 7:22 AM
Points: 46,
Visits: 107
Through stored procedure i am selecting some values. I want to add couple of line in the end of sp to copy those values into one text file and plce that text in file into one location.
Post #935231
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Thursday, June 10, 2010 9:36 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 4:46 PM
Points: 31,433,
Visits: 13,745
SQL Server can't work with files directly. How is the stored procedure being called? Is there some reason you can't use SSIS and then call a job to run that instead?
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #935458
Random Visitor
Random Visitor
Posted Monday, January 23, 2012 8:31 AM
Grasshopper
Group: General Forum Members
Last Login: Thursday, October 11, 2012 9:51 AM
Points: 16,
Visits: 107
I too have a similar requirement but we don't have SSIS installed so is there any way a Job can be run to direct the output from an executed sp to a file?
Post #1240238
Dev
Dev
Posted Monday, January 23, 2012 8:37 AM
SSCrazy
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 2:05 PM
Points: 2,013,
Visits: 1,566
Please start another thread for your question & provide details. It will help us focusing on your issue specifically & won’t mix the responses for previous question.
~Dev~
Post #1240246
« Prev Topic
|
Next Topic »
11 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.