I need to create a directory for sql server backups. I have to dynamically place the backup file in different folders on many different sql server installs. The backup fails if the directory doesn't exist. So if I can create the directory in a stored procedure or some other call before I call the backup command that would be helpful. Any ideas?
Thanks
Step 1 : First of all you should select the respective filetable in which you need to create a folder and right click on it and select “Explore filetable directory” as shown in the image below. Step 2 : Once you select “Explore filetable directory”, it will open that particular filetable directory folder.
Create Database using SQL Server Management Studio. Open SSMS and in Object Explorer, connect to the SQL Server instance. Expand the database server instance where you want to create a database. Right-click on Databases folder and click on New Database..
Try
declare @Path varchar(100)
set @Path = 'c:\CreatedFromSQL'
EXEC master.dbo.xp_create_subdir @Path
Sourced from http://www.mssqltips.com/tip.asp?tip=1460
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With