Data Base path for stream DB creation 2008 R2
Well Dears all, today i have an issue to ask around the creation of a Streaming Data Base.
I have create a Stored procedure which is creates the Streaming Data Base. This SP needs to have the path on 开发者_开发问答which will put the mdf files (and some other things). Until now i was run this procedure after i first create the above mentioned path. Now i want to run the same procedure without interference in the server. So I give the following path in order the procedure to execut it and understand where i want to give the path guide.\\ServerName\SharedFolderName\SQL\
The stored procedure takes the path and tries to go to the folder of 'SQL' in order to do her job.
But in this point i receive an error which says:CREATE DATABASE failed. Some file names listed could not be created, Check related errors.
-I'm Cheking the way of puting the path and it is absolutelly right, I mean accepted from the server machine and from the client machine as well.
Is there somone who's have any idea in order to do what i want in the way i want?This error can be caused by a lot of things.
First of all, make sure that the folder 'SQL' actually exists and that the mdf file does not exist. (the Create Database command cannot overwrite).
Next, make sure that the following condtions are met:
- The SQL Server service should be running under a domain account.
- This domain account must have read/write privileges on the folder you are trying to create the file in.
---------- EDIT
Ok, I think I understand your problem a little better now. You need a way to create the ' SQL' folder from your stored procedure before creating the Database, because the 'CREATE DATABASE' command does not create the folder for you, buth throws an error instead, right?
You can do this by calling the master.sys.xp_create_subdir extended stored procedure, like this:
EXEC master.sys.xp_create_subdir '\\ServerName\SharedFolderName\SQL'
I hope this will help you a little further.
精彩评论