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.
Author |
Topic |
immad
Posting Yak Master
230 Posts |
Posted - 2014-12-15 : 02:26:58
|
hi,can any one help me . how to export data in text file using sql server 2008 job.please help me out,thanks for the help.immad uddin ahmed |
|
ChinmayBairagi
Starting Member
1 Post |
Posted - 2014-12-15 : 02:45:58
|
How can I Use one sql database use by multiple computer? I am using sql server 2008 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2014-12-15 : 02:57:20
|
Chinmay,please post your query as a separate topic.Immad you can do it using multiple ways.1.Openrowset2.BCP3.SSISyou can then schedule script into a sql agent job.Javeed Ahmedhttps://www.linkedin.com/pub/javeed-ahmed/25/5b/95 |
|
|
immad
Posting Yak Master
230 Posts |
Posted - 2014-12-15 : 04:26:17
|
quote: Originally posted by ahmeds08 Chinmay,please post your query as a separate topic.Immad you can do it using multiple ways.1.Openrowset2.BCP3.SSISyou can then schedule script into a sql agent job.Javeed Ahmedhttps://www.linkedin.com/pub/javeed-ahmed/25/5b/95
Please sir send me a demo of 1.Openrowset2.BCP3.SSISthanks for the helpimmad uddin ahmed |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2014-12-15 : 05:21:42
|
using BCP,it should be like thisDECLARE @saveas VARCHAR(2048),@query VARCHAR(2048),@bcpquery VARCHAR(2048),@bcpconn VARCHAR(64),@bcpdelim VARCHAR(2) SET @query = 'SELECT col1,col2 FROM [Table]' SET @saveas = 'E:\one.txt' SET @bcpdelim = '|' SET @bcpconn = '-T' SET @bcpquery = 'bcp "' + replace(@query, char(10), '') + '" QUERYOUT "' + @saveas + '" -c -t^' + @bcpdelim + ' ' + @bcpconn + ' -S ' + @@servernameEXEC master..xp_cmdshell @bcpquery Javeed Ahmedhttps://www.linkedin.com/pub/javeed-ahmed/25/5b/95 |
|
|
|
|
|
|
|