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 |
|
dhani
Posting Yak Master
132 Posts |
Posted - 2010-04-14 : 18:11:19
|
| Hello All,Please help me with this really new problemin my c:\ drive no temp directory yet,then now in my sql server table i have a column call directorypath with values asc:\Temp\t1\midcap1\belzer1c:\Temp\t1\midcap1\belzer2c:\Temp\t1\midcap1\belzer3c:\Temp\t1\midcap1\belzer4c:\Temp\t1\midcap1\Delzer23c:\Temp\t1\midcap1\Celzer22c:\Temp\t1\midcap1\Celzer12c:\Temp\t1\midcap1\Celzer13c:\Temp\t1\midcap1\Celzer14c:\Temp\t1\midcap1\Celzer15c:\Temp\t1\midcap1\Celzer16c:\Temp\t1\midcap1\Eelzer22c:\Temp\t1\midcap1\Eelzer23c:\Temp\t1\midcap1\Eelzer24how can i make any sql statement so that it creates the above directoriespresently what i am doing is 1)select distinct 'mkdir "' + RTRIM(DirectoryPath) + '"' from sa.storefiles2)then copy all entries and save in a text file and save it as .bat(batch file) 3)then execute the batch file in command promptbut now i would like to know is there any way that i can execute directly from sql server itself to create directories (any sql statement or t-sql stuff) pleaseHelp me Thanks alot in advanceDhani |
|
|
DBA in the making
Aged Yak Warrior
638 Posts |
Posted - 2010-04-14 : 18:25:47
|
| You can use xp_cmdshell to execute dos commands.------------------------------------------------------------------------------------Any and all code contained within this post comes with a 100% money back guarantee. |
 |
|
|
dhani
Posting Yak Master
132 Posts |
Posted - 2010-04-15 : 17:22:30
|
| Hello Guru,Thanks i will work on it and let you knowThanks & Regardsdhani |
 |
|
|
|
|
|