DuNuNuBatman
asked on
aspnet_regsql question
I am running sql express that came with my visual studio program. Anyway, I am trying to run aspnet_regsql on my machine but I keep getting an error.
Start adding the following features:
Membership
Profile
RoleManager
.
An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 5133 and the SqlException message is: Directory lookup for the file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ C:\Users\J osh\Docume nts\Visual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf.mdf" failed with the operating system error 123(The filename, directory name, or volume label syntax is incorrect.).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating the C:\Users\Josh\Documents\Vi sual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf database...
SQL Server: localhost\SQLExpress
Database: [C:\Users\Josh\Documents\V isual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf]
SQL file loaded:
InstallCommon.sql
Commands failed:
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)
SET @dboptions = N'/**/'
SET @dbname = N'C:\Users\Josh\Documents\ Visual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf'
IF (NOT EXISTS (SELECT name
FROM master.dbo.sysdatabases
WHERE name = @dbname))
BEGIN
PRINT 'Creating the ' + @dbname + ' database...'
DECLARE @cmd nvarchar(500)
SET @cmd = 'CREATE DATABASE [' + @dbname + '] ' + @dboptions
EXEC(@cmd)
END
SQL Exception:
System.Data.SqlClient.SqlE xception: Directory lookup for the file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ C:\Users\J osh\Docume nts\Visual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf.mdf" failed with the operating system error 123(The filename, directory name, or volume label syntax is incorrect.).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating the C:\Users\Josh\Documents\Vi sual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf database...
at System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection)
at System.Data.SqlClient.TdsP arser.Thro wException AndWarning (TdsParser StateObjec t stateObj)
at System.Data.SqlClient.TdsP arser.Run( RunBehavio r runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlC ommand.Run ExecuteNon QueryTds(S tring methodName, Boolean async)
at System.Data.SqlClient.SqlC ommand.Int ernalExecu teNonQuery (DbAsyncRe sult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlC ommand.Exe cuteNonQue ry()
at System.Web.Management.SqlS ervices.Ex ecuteFile( String file, String server, String database, String dbFileName, SqlConnection connection, Boolean sessionState, Boolean isInstall, SessionStateType sessionStatetype)
Start adding the following features:
Membership
Profile
RoleManager
.
An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 5133 and the SqlException message is: Directory lookup for the file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating the C:\Users\Josh\Documents\Vi
SQL Server: localhost\SQLExpress
Database: [C:\Users\Josh\Documents\V
SQL file loaded:
InstallCommon.sql
Commands failed:
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)
SET @dboptions = N'/**/'
SET @dbname = N'C:\Users\Josh\Documents\
IF (NOT EXISTS (SELECT name
FROM master.dbo.sysdatabases
WHERE name = @dbname))
BEGIN
PRINT 'Creating the ' + @dbname + ' database...'
DECLARE @cmd nvarchar(500)
SET @cmd = 'CREATE DATABASE [' + @dbname + '] ' + @dboptions
EXEC(@cmd)
END
SQL Exception:
System.Data.SqlClient.SqlE
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating the C:\Users\Josh\Documents\Vi
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.TdsP
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlC
at System.Web.Management.SqlS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please give the statement that you run with complete file name
ASKER
aspnet_regsql -A mrp -C "Data Source=.\SQLEXPRESS;Integr ated Security=True;User Instance=True" -d "C:\Users\Josh\Documents\V isual Studio Codename Orcas\Projects\DTC\Website \App_Data\ DtcDatabas e.mdf"
ASKER
alright, I figured it out. When I tried to attach the database using sql server management studio, I noticed I couldn't browse past the C:\Users\Josh directory. I then tried to manually put in the path to the mdf file and got the same error. So I changed the permissions to my users directory and sub dirs and that fixed it. So I was just having some weird permissions issues.
Anyway, it ran, problem solved. Thanks for the help!
Anyway, it ran, problem solved. Thanks for the help!
ASKER