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)
 SQL Script for Create a file and folder in SQL server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-01 : 07:39:19
Kasi writes "Hai,

I want to create a file name based on the system date and stores the reports into that. Can you help me how to write a sql script code for creating a file or folder in SQL Server "

chadmat
The Chadinator

1974 Posts

Posted - 2002-02-01 : 12:58:44
You will have to use dynamic sql (see FAQ) and master..xp_cmdshell


Like:
declare @sql varchar(1000)
select @sql = 'master..xp_cmdshell "mkdir c:\whatever"'

execute(@sql)


HTH
-Chad

Go to Top of Page
   

- Advertisement -