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 2000 Forums
 SQL Server Development (2000)
 output textfile and automatically zip

Author  Topic 

nehj76
Starting Member

15 Posts

Posted - 2007-07-24 : 12:03:38
hi.. is there a way to automatically zip the output textfile with password?

ex..

declare @OutFile varchar(18)

set @OutFile = 'si07212003'

set @SQL='bcp "select * from dbo.products" queryout c:\test\Dataout\'+@OutFile+'.txt'+' -c -T -SQADB '

EXEC master..xp_cmdshell @SQL

i want to zip c:\test\dataout\si07212003.txt, password protected..

thanks


spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-24 : 12:31:28
EXEC master..xp_cmdshell 'your zip command for the created file'

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -