SSMS Collation conflict when expand Tables - sql-server

some strange SSMS behaviour annoyed me for the last few days.
I'm using EF Core 5 Code First and trying to create a test database with EnsureCreated(). The code runs fine and database appears on my local server. But when I try to expand Tables in SSMS I get following error:
I'm using mssql docker container which is configured for German language (MSSQL_LCID: 1031).
Also, we have production database dumps that I can restore on my local machine and get everything work fine.
Here are default server and database collation which I found in properties:
server: SQL_Latin1_General_CP1_CI_AS
database from dump: Latin1_General_CI_AS
database from EnsureCreated(): Latin1_General_CI_AS
So as you see collations for each databases are the same. But I don't get conflict on restored one!
UPDATE:
Here are some details of error (retrieved by clicking Show details button)
===================================
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
------------------------------
For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.NavigableItemBuilderDataReader.RunQuery()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.NavigableItemBuilderDataReader.Process()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.NavigableItemBuilderDataReader.get_PropertyNames()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NonContextFilterNavigableItemBuilder.Build(IList`1 targetList, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.GetExecuteReader(SqlCommand command)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String sqlCommand, SqlCommand& command)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataReader(String query, SqlCommand& command)
at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.GetData(EnumResult erParent)
at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()
at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request req, Object ci)
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
===================================
Ein Sortierungskonflikt zwischen "Latin1_General_CI_AS" und "SQL_Latin1_General_CP1_CI_AS" im UNION ALL-Operator, der in der 2-Spalte der SELECT-Anweisung auftritt, kann nicht aufgelöst werden.
Die Sicht oder Funktion "sys.all_columns" konnte aufgrund von Bindungsfehlern nicht verwendet werden. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=14.00.3411&EvtSrc=MSSQLServer&EvtID=451&LinkId=20476
------------------------------
Server Name: localhost
Error Number: 451
Severity: 16
State: 1
Procedure: all_columns
Line Number: 2
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.GetExecuteReader(SqlCommand command)
Seems like it comes from view all_columns. I also can't do any select from this system view nor event see its columns.

Related

Error Importing flat files into Microsoft SQL Server Management Studio 18 -- "System Out of Memory"

I have an approximately 10 GB Excel CSV that I am trying to import into a SQL Database. When I use the import flat file option / wizard the file starts to import for about 10-15 seconds before running into a System Out of Memory Exception Error. The follow is the error output and screenshots.
Any information is greatly appreciated!
Detailed Error Output:
Error inserting data into table. (Microsoft.SqlServer.Import.Wizard)
------------------------------
Program Location:
at Microsoft.SqlServer.Import.Wizard.InsertData.ResultCheck(Result result)
at Microsoft.SqlServer.Import.Wizard.InsertData.DoWork()
at Microsoft.SqlServer.Management.TaskForms.SimpleWorkItem.Run()
===================================
Error inserting data into table. (Microsoft.SqlServer.Prose.Import.SDS)
------------------------------
Program Location:
at Microsoft.SqlServer.Prose.Import.BcpTextSynthesis.InsertIntoDB(String inputFilePath, String tableName, String schemaName, IReadOnlyList`1 columnInfo, SqlConnection connection, Int32 batchSize, SqlTransaction transaction, IList`1 allFinalTransformations, IList`1 allFinalTransformationColumns, IList`1 allFinalColNames)
at Microsoft.SqlServer.Prose.Import.BcpProcess.CreateTableAndInsertDataIntoDb(String connectionString, Int32 batchSize, String azureAccessToken)
===================================
Exception of type 'System.OutOfMemoryException' was thrown. (mscorlib)
------------------------------
Program Location:
at System.Text.StringBuilder.ToString()
at Microsoft.ProgramSynthesis.Read.FlatFile.Semantics.Semantics.<SplitLines>d__17.MoveNext()
at Microsoft.ProgramSynthesis.Read.FlatFile.Semantics.Semantics.<Csv>d__9.MoveNext()
at System.Linq.Enumerable.<SkipIterator>d__31`1.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.SqlServer.Prose.Import.BcpTextSynthesis.InsertIntoDB(String inputFilePath, String tableName, String schemaName, IReadOnlyList`1 columnInfo, SqlConnection connection, Int32 batchSize, SqlTransaction transaction, IList`1 allFinalTransformations, IList`1 allFinalTransformationColumns, IList`1 allFinalColNames)
[Image of Import Wizard][1]
[Error Image 'System.OutOfMemoryException' was thrown][2]
For large files like that, look into using Bulk Insert.
I used the Bulk insert command as per below and please make sure that the files to be load is on the SQL server and not on your local/remote machine.
BULK INSERT dbo.TABLE
FROM 'E:\YOUR_FILES.csv'
WITH ( FORMAT = 'CSV',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n' );

Create non clustered index times out

While creating a non-clustered index on a table using SSMS, I get this message. I tried changing the timeout setting on the database thus, but it doesn't help:
USE Options ;
GO
EXEC sp_configure 'remote query timeout', 0 ;
GO
RECONFIGURE ;
GO
The sql server error:
===================================
Create failed for Index 'NonClusteredIndex-20200121-151256'. (Microsoft.SqlServer.Smo)
------------------------------
For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=15.0.18142.0+((SSMS_Rel).190722-0816)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Index&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
at Microsoft.SqlServer.Management.Smo.Index.Create()
at Microsoft.SqlServer.Management.Smo.IndexExtender.IndexExtenderHelper.Execute(IndexAction action)
at Microsoft.SqlServer.Management.RelationalEngineTasks.IndexTaskFormComponent.PerformTask(ITaskExecutionContext context)
at Microsoft.SqlServer.Management.RelationalEngineTasks.IndexTaskFormComponent.Microsoft.SqlServer.Management.ITask.Perform(ITaskExecutionContext )
at Microsoft.SqlServer.Management.TaskForms.TaskExecutionManager.ExecuteTaskSequence(ISfcScriptCollector collector)
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType, Boolean retry)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries, Boolean retry)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext, Boolean executeForAlter)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplFinish(StringCollection createQuery, ScriptingPreferences sp)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
===================================
**Execution Timeout Expired.** The timeout period elapsed prior to completion of the operation or the server is not responding. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-2&LinkId=20476
------------------------------
Server Name: DELLR410
Error Number: -2
Severity: 11
State: 0
------------------------------
Program Location:
When working with large (millions of records) tables it is advised not to use the built-in functionality of SSMS to do this but via a script. Personally I always use a remote session on the server itself when I run these scripts on large tables, to protect the execution of the script as much as I can (SSMS on my laptop might crash or the network connection gets interrupted etc).

How to give MSSQL$SQL2016 permissions to write to a folder

Morning,
I have hit a brick wall and I need pointing in the right direction.
What I am trying to do is give my SQL Server instance permission to create the MDB / LDB files in a directory on a new hard drive I have installed on my local machine, without using Everyone.
When I try to create a new database in the folder (through management studio) I get the following error:
===================================
Create failed for Database 'TestDatabase1'. (Microsoft.SqlServer.Smo)
------------------------------
For help, click: http://go.microsoft.com /fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.16106.4+((SSMS_Rel_16_5).170125-2137)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype.ApplyChanges(Control marshallingControl)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabase.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType, Boolean retry)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries, Boolean retry)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext, Boolean executeForAlter)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplFinish(StringCollection createQuery, ScriptingPreferences sp)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
===================================
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'D:\MSSQL\Data\TestDatabase1.mdf'.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.4224&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476
------------------------------
Server Name: my_machine\SQL2016
Error Number: 5123
Severity: 16
State: 1
Line Number: 1
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
The SQL Server instance is logging on using "NT Service\MSSQL$2016".
I have checked the original data folder and MSSQL$2016 has permissions to read and write.
I've had a look at these posts:
https://blog.sqlauthority.com/2018/08/25/sql-server-fix-create-file-encountered-operating-system-error-5-access-is-denied/
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-file-system-permissions-for-database-engine-access?view=sql-server-2017
https://serverfault.com/questions/507496/sql-server-2012-with-account-nt-service-mssqlserver-access-is-denied-in-domain
http://documentation.sqlserverbooster.com/en/1_1_2/SQLServerBoosterDocumentation.html?AddingreadwritepermissionstoNTSe.html
https://dba.stackexchange.com/questions/70069/how-do-i-give-file-system-access-to-sql-servers-sqlserveragent-virtual-account
I have also tried adding the following to the folder by right clicking on the folder->properties->Security, none of which have worked
NT Service\MSSQL$SQL2016
[NT Service\MSSQL$SQL2016]
[NT Service]\MSSQL$SQL2016
[NT Service]\[MSSQL$SQL2016]
MSSQL$SQL2016
When I click on the Check Names it cannot find it.
If it makes any difference this is on a Windows 10 PC on a domain.
I have missed something obvious but I am not sure what it is. If you could point me at a document, it would be greatly appreciated.
At my machine the solution was assigning user:
NT Service\MSSQL$MSSQLSERVER2016 (instead of MSSQL$MSSQLSERVER2016)
in the dialog box where you manage access rights to concrete directory.
On my side, I followed this documentation
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-file-system-permissions-for-database-engine-access?view=sql-server-ver15
In a nutshell, I had to search for the user NT SERVICE\MSSQLSERVER
This worked for me:
NT Service\MSSQL$SQL2016
Give full permission
I had the same problem. When I tried to add the user to the folder, the list did not contained my user. So I copied the user from sql configuration and then paste it in the security settings for the folder.

Cannot change MS SQL user password. Error 15010 Database does not exist

I have a dev server with a bunch of old and new databases, I went to change the password for one of the SQL users but I got an error stating SQL could not find database files for TriModal. It was in the list of databases so I deleted it. Now I get this error.
Alter failed for Login 'TRNJApp'. (Microsoft.SqlServer.Smo)
The database 'TriModal' does not exist. Supply a valid database name. To see available databases, use sys.databases. (Microsoft SQL Server, Error: 15010)
When I edit that user's User Mapings I get the message
One or more databases are inaccessible and will not be displayed in list.
TriModal does not appear in SELECT * FROM MASTER.SYS.DATABASES
Any ideas to rectify the problem?
SQL Technical information for the Error
Alter failed for Login 'TRNJApp'. (Microsoft.SqlServer.Smo)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1750.9+((dac_inplace_upgrade).101209-1051+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Login&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
at Microsoft.SqlServer.Management.Smo.Login.Alter()
at Microsoft.SqlServer.Management.SqlManagerUI.CreateLoginData.LoginPrototype.ApplyGeneralChanges(Server server)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateLogin.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplFinish(StringCollection alterQuery, ScriptingOptions so)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplWorker()
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
===================================
The database 'TriModal' does not exist. Supply a valid database name. To see available databases, use sys.databases. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3073&EvtSrc=MSSQLServer&EvtID=15010&LinkId=20476
------------------------------
Server Name: 192.168.1.27
Error Number: 15010
Severity: 16
State: 1
Line Number: 1
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
As mentioned in the comments.
The users' Default Database was blank but must have previously been TriModal. I set it to another database and everything is working.

Generate SQL scripts from Azure SQL Database

When I tried to Generate scripts in SQL Server Management Studio 2012 from my Azure database. I received following error:
Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptPublishException:
An error occurred while scripting the objects. --->
Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException: Failed to
retrieve data for this request. --->
Microsoft.SqlServer.Management.Sdk.Sfc.InvalidVersionEnumeratorException:
Operation not supported on version 11.0 SqlAzureDatabase. at
Microsoft.SqlServer.Management.Smo.XmlReadDoc.LoadFile(Assembly a,
String strFile) at
Microsoft.SqlServer.Management.Smo.SqlObject.LoadInitData(String file,
ServerVersion ver, DatabaseEngineType databaseEngineType) at
Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.LoadElement(ObjectLoadInfo
oli, ServerVersion ver, DatabaseEngineType databaseEngineType) at
Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.GetElement(ObjectLoadInfo
oli, ServerVersion ver, DatabaseEngineType databaseEngineType) at
Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.GetAllElements(Urn
urn, ServerVersion ver, DatabaseEngineType databaseEngineType, Object
ci) at
Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetObjectsFromCache(Urn
urn, Object ci) at
Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request
req, Object ci) at
Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object
connectionInfo, Request request) at
Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object
connectionInfo, Request request) --- End of inner exception stack
trace --- at
Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object
connectionInfo, Request request) at
Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorData(Request
req) at
Microsoft.SqlServer.Management.Smo.Server.GetLCIDCollation(String
collationName) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetComparerFromCollation(String
collationName) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean
inServer) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
at Microsoft.SqlServer.Management.Smo.Database.PreInitChildLevel() at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitChildLevel(Urn
levelFilter, ScriptingPreferences sp, Boolean forScripting) at
Microsoft.SqlServer.Management.Smo.DatabasePrefetchBase.InitializeObjectCollection(String
type) at
Microsoft.SqlServer.Management.Smo.DatabasePrefetchBase.d__1.MoveNext()
at
Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.SfcChildrenDiscovery(HashSet1
discoveredUrns) at
Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.Discover(IEnumerable1
urns) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.Discover(IEnumerable1
urns) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable1
urns) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List`1
urns, ISmoScriptWriter writer) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.Script(Urn[] urns,
ISmoScriptWriter writer) at
Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptGenerator.DoScript(ScriptOutputOptions
outputOptions) --- End of inner exception stack trace --- at
Microsoft.SqlServer.Management.SqlScriptPublish.GeneratePublishPage.worker_DoWork(Object
sender, DoWorkEventArgs e) at
System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at
System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object
argument)
I found this thread: Failed to generate scripts for Sql Azure database: "Getting the list of objects from : failed"
but I cannot use: http://cloudservices.red-gate.com/
Try using third party tools for SQL Server that are able to work with Azure. I think SQL Compare from Red-Gate had the ability to work with SQL Azure but I’m not 100% sure. You can always use it in trial mode to get the job done…
SQL Azure Migration wizard might be an option for you as well.
http://sqlazuremw.codeplex.com/

Resources