Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Result to text

Author  Topic 

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-03-18 : 02:58:23
Is there in any option to set result to text by query

Vaibhav T

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 03:54:39
I dont know the query
The shortcut is CONTROL+T

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-03-18 : 05:12:05
Thanks for the reply
but through the query can i export the data in text file
as i have a lot of result set with my query and i have to copy and paste it in file.

Vaibhav T
Go to Top of Page

haroon2k9
Constraint Violating Yak Guru

328 Posts

Posted - 2010-03-18 : 05:17:20
can be done by BCP utility..

EXEC master..xp_cmdshell
'bcp "select * from DBANME..TBLNAME" queryout c:\resultset.txt -c -Usa -P'

please look for BCP in BOL.
Go to Top of Page

haroon2k9
Constraint Violating Yak Guru

328 Posts

Posted - 2010-03-18 : 05:18:22
quote:
Originally posted by madhivanan

I dont know the query
The shortcut is CONTROL+T

Madhivanan

Failing to plan is Planning to fail



Madhi,OP Requesting for exporting result set to a text file.please correct me if iam wrong.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 08:41:43
quote:
Originally posted by haroon2k9

quote:
Originally posted by madhivanan

I dont know the query
The shortcut is CONTROL+T

Madhivanan

Failing to plan is Planning to fail



Madhi,OP Requesting for exporting result set to a text file.please correct me if iam wrong.


Thanks. From the Original post it was not much clear
Here is one more
http://beyondrelational.com/blogs/madhivanan/archive/2007/08/27/bcp-export-data-to-text-file.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-03-18 : 08:45:01
quote:
Originally posted by madhivanan

quote:
Originally posted by haroon2k9

quote:
Originally posted by madhivanan

I dont know the query
The shortcut is CONTROL+T

Madhivanan

Failing to plan is Planning to fail



Madhi,OP Requesting for exporting result set to a text file.please correct me if iam wrong.


Thanks. From the Original post it was not much clear
Here is one more
http://beyondrelational.com/blogs/madhivanan/archive/2007/08/27/bcp-export-data-to-text-file.aspx

Madhivanan

Failing to plan is Planning to fail



Original post was that only what you understood but as i m not able to find the option to set result to text by query so this is what the alternative for which i m trying to do.


Vaibhav T
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 08:52:19
If you want to export to text while running the query, press CONTROL+SHIFT+F and run the query. It will prompt you to save the result to a file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -