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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-06-14 : 07:26:18
|
m.nazari writes "hello how can i export data from sql server to text file with a sql command ( i want to run it in store procedure >?m.nazari" |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-14 : 07:47:31
|
[code]Create Procedure ExportToText (@DBName varchar(100),@tableName varchar(100))asExec('Exec Master..xp_cmdShell ''bcp "Select * from '+@DBName+'..'+@tablename+'" queryout "C:\text.txt" -c''')[/code]MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|