1
Vote

SQL error using dbo privledges.

description

Sorry for the long post but wasn't sure which parts would be helpful. I am using an ID with dbo privledges. Info:: SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: The specified schema name "nfit_" either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) /************************************************************/ /***** SqlDataProvider *****/ /************************************************************/ /****** Objet : Table nfit_.[param_trombinoscope] Date du script : 01/09/2008 14:04:33 ******/ CREATE TABLE nfit_.[param_trombinoscope] ( [chemin_photos_absolu] [varchar] (255) COLLATE French_CI_AS NULL , [chemin_photos_relatif] [varchar] (255) COLLATE French_CI_AS NULL ) ON [PRIMARY] System.Data.SqlClient.SqlException: The specified schema name "nfit_" either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) /****** Objet : Table nfit_.[salaries] Date du script : 01/09/2008 14:04:33 ******/ CREATE TABLE nfit_.[salaries] ( [id_salaries] [int] IDENTITY (1, 1) NOT NULL , [nom] [varchar] (50) COLLATE French_CI_AS NOT NULL , [prenom] [varchar] (50) COLLATE French_CI_AS NOT NULL , [matricule] [int] NOT NULL , [service] [int] , [fonction] [varchar] (50) COLLATE French_CI_AS NULL ) ON [PRIMARY] System.Data.SqlClient.SqlException: The specified schema name "nfit_" either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) /****** Objet : Table nfit_.[services] Date du script : 01/09/2008 14:04:33 ******/ CREATE TABLE nfit_.[services] ( [id_services] [int] IDENTITY (1, 1) NOT NULL , [nom] [varchar] (50) COLLATE French_CI_AS NOT NULL , [parent] [int] NULL , [id_chef_de_service_1] [int] NULL , [id_chef_de_service_2] [int] NULL , [id_secretaire_1] [int] NULL , [id_secretaire_2] [int] NULL , [direction] [int] NULL ) ON [PRIMARY] System.Data.SqlClient.SqlException: The specified schema name "nfit_" either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) /****** Objet : Table nfit_.[directions] Date du script : 01/09/2008 14:04:33 ******/ CREATE TABLE nfit_.[directions] ( [id_direction] [int] IDENTITY (1, 1) NOT NULL , [nom] [varchar] (50) COLLATE French_CI_AS NOT NULL ) ON [PRIMARY] System.Data.SqlClient.SqlException: Cannot find the object "nfit_.salaries" because it does not exist or you do not have permissions. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) ALTER TABLE nfit_.[salaries] ADD CONSTRAINT [PK_salaries] PRIMARY KEY CLUSTERED ( [id_salaries] ) ON [PRIMARY] System.Data.SqlClient.SqlException: Cannot find the object "nfit_.services" because it does not exist or you do not have permissions. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) ALTER TABLE nfit_.[services] ADD CONSTRAINT [PK_services] PRIMARY KEY CLUSTERED ( [id_services] ) ON [PRIMARY] System.Data.SqlClient.SqlException: Cannot find the object "nfit_.directions" because it does not exist or you do not have permissions. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) ALTER TABLE nfit_.[directions] ADD CONSTRAINT [PK_directions] PRIMARY KEY CLUSTERED ( [id_direction] ) ON [PRIMARY] System.Data.SqlClient.SqlException: Cannot find the object "nfit_.salaries" because it does not exist or you do not have permissions. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) ALTER TABLE nfit_.[salaries] ADD CONSTRAINT [FK_salaries_services] FOREIGN KEY ( [service] ) REFERENCES nfit_.[services] ( [id_services] ) System.Data.SqlClient.SqlException: Cannot find the object "nfit_.services" because it does not exist or you do not have permissions. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) ALTER TABLE nfit_.[services] ADD CONSTRAINT [FK_services_directions] FOREIGN KEY ( [direction] ) REFERENCES nfit_.[directions] ( [id_direction] ), CONSTRAINT [FK_services_salaries] FOREIGN KEY ( [id_chef_de_service_1] ) REFERENCES nfit_.[salaries] ( [id_salaries] ), CONSTRAINT [FK_services_salaries1] FOREIGN KEY ( [id_chef_de_service_2] ) REFERENCES nfit_.[salaries] ( [id_salaries] ), CONSTRAINT [FK_services_salaries2] FOREIGN KEY ( [id_secretaire_1] ) REFERENCES nfit_.[salaries] ( [id_salaries] ), CONSTRAINT [FK_services_salaries3] FOREIGN KEY ( [id_secretaire_2] ) REFERENCES nfit_.[salaries] ( [id_salaries] ), CONSTRAINT [FK_services_services] FOREIGN KEY ( [parent] ) REFERENCES nfit_.[services] ( [id_services] )

comments

davidwendelken wrote May 5, 2011 at 12:57 AM

The above problem should be easy to fix if my diagnosis is correct. I believe your script does not properly handle an {objectQualifier} token. It is treating it like a schema name instead of a prefix to the table name. You have statements like:
create table {objectqualifier}.[tablename]

I think it is supposed to be:
create table {databaseOwner}[{objectQualifier}tablename]

davidwendelken wrote May 5, 2011 at 2:34 AM

The entire set of database scripts (install and uninstall) need to be thoroughly vetted for this mistake. All names need to match in both the install and uninstall scripts. They need to match in the existence checks and the create/drop/alter statements. The objectqualifier property is defined when the system is installed. I suspect it's in the host or site settings somewhere. These scripts need to be tested on a system that is using a value in that field.

In addition, there are not existence checks for each object. This means that the above errors are made worse because code that should be ignored on the second try to uninstall will fail.

wrote Feb 13, 2013 at 9:51 PM