[Błąd]–błąd podczas pracy z Mozartem (błędnie przypisany default schema)

Opis

Podczas uruchamiania Mozart Produkcja pojawia się komunikat błedu.

Przyczyna

Problem wynika z tego ze ci użytkownicy maja źle przypisaną default schema. Powinni mieć dbo, a maja swoja prywatna. Najlepiej aby każdy z Użytkownik miał po prostu poprawnie przypisaną scheme do dbo

Rozwiązanie

Należy uruchomić poniższy skrypt SQL na bazie Mozarta

SELECT name, type_desc, default_schema_name
FROM sys.database_principals
WHERE type in (‘S’, ‘U’, ‘G’);

Skrypt wykonujemy na bazie Mozarta (program dla małej firmy produkcyjnej), nie na bazie systemu magazynowego.

Mozart, 1.11.138.127: System.Data.SqlClient.SqlException (0x80131904): Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Cannot drop the view ‘xpoTowViewMag’, because it does not exist or you do not have permission.
Błąd usunięcia widoków
w System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
w System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
w System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
w System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
w System.Data.SqlClient.SqlDataReader.get_MetaData()
w System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
w System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
w System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
w System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
w System.Data.SqlClient.SqlCommand.ExecuteScalar()
w Mozart.Baza.Db.DeleteView(Boolean argCzyKom) w G:\Source codes\!MozartAktualny\code\Mozart.DAL\Baza\Progs\Db.cs:wiersz 606
ClientConnectionId:0084d2a1-c46a-4b40-bbac-4d1d1b4968dc
Error Number:3701,State:5,Class:11

Scroll to Top