[SQL 2005]impossibilité de créer une base ds Program Files
Bonjour,
j'essai de créer une base dans le dossier "Program Files" ou dans le dossier "Documents and settings" mais j'y arrive pas à cause de droits à priori, voila le script que j'utilise :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
USE master;
GO
IF DB_ID (N'Archive') IS NOT NULL
DROP DATABASE Archive;
GO
-- Get the SQL Server data path
DECLARE @data_path nvarchar(256);
SET @data_path = 'C:\Documents and Settings\MORSI\Bureau\OA\'
-- execute the CREATE DATABASE statement
EXECUTE ('CREATE DATABASE Archive
ON
PRIMARY
(NAME = Arch1,
FILENAME = '''+ @data_path + 'archdat1.mdf'',
SIZE = 100MB,
MAXSIZE = 200,
FILEGROWTH = 20),
( NAME = Arch2,
FILENAME = '''+ @data_path + 'archdat2.ndf'',
SIZE = 100MB,
MAXSIZE = 200,
FILEGROWTH = 20),
( NAME = Arch3,
FILENAME = '''+ @data_path + 'archdat3.ndf'',
SIZE = 100MB,
MAXSIZE = 200,
FILEGROWTH = 20)
LOG ON
(NAME = Archlog1,
FILENAME = '''+ @data_path + 'archlog1.ldf'',
SIZE = 100MB,
MAXSIZE = 200,
FILEGROWTH = 20),
(NAME = Archlog2,
FILENAME = '''+ @data_path + 'archlog2.ldf'',
SIZE = 100MB,
MAXSIZE = 200,
FILEGROWTH = 20)'
);
GO |
l'erreur est :
Citation:
Directory lookup for the file "C:\Documents and Settings\MORSI\Bureau\OA\archdat1.mdf" failed with the operating system error 5(Accès refusé.).
Msg 1802, Niveau 16, État 1, Ligne 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
j'y arrive pas aussi à créer directement sur le C:\ mais si je crée un répertoir je pourrais.
en fait comment je peux règler ce problème d'accés, en plus j'essai de créer une installation automatique, est ce que je peux résoudre automatiquement ce problème ?
En vous remerciant !