Error deploying a DACPAC to a SQL Azure server - azure-sql-database

Using a VS2010 SP1 Data-tier application project, I created the simplest database I could:
CREATE TABLE [dbo].[Table1]
(
column_1 int NOT NULL,
column_2 int NULL
)
I then successfully built the .dacpac, and verified it by deploying it using SSMS 2008 R2 to a local SQL Express instance (everything worked fine).
I then tried using SSMS 2008 R2 to deploy the .dacpac to a SQL Azure server. The wizard managed to get through every step (including creating the database and creating the schema), but failed on the last step - "Registering the DAC in DAC metadata" - with an IndexOutOfRangeException (see below).
I tried to do this against an existing SQL Azure server, against a new SQL Azure server (both fail with the same exception), and against a SQL Azure server with an empty database by the same name (this one failed with an SSMS runtime exception).
I'm now out of ideas. Any ideas on how to deploy .dacpacs to SQL Azure would be greatly appreciated.
System.IndexOutOfRangeException: Index was outside the bounds of the
array. at
Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String
propertyName, PropertyAccessPurpose pap) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean
inServer) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
at
Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()
at
Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()
at
Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()
at
Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase
key) at
Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String
name) at Microsoft.SqlServer.Management.Dac.RegisterDacStep.Execute()
at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ManagedActionStep.TransactionalStep.DoExecute()
at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ManagedActionStep.Execute()
at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ExecuteActionSteps(IEnumerable`1
managedActionSteps) at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.Go() at
Microsoft.SqlServer.Management.Dac.DacStore.Install(DacType dacType,
DatabaseDeploymentProperties deploymentProperties, Boolean
skipPolicyValidation, Boolean skipDacRegistration)

Do you have the latest build of SSMS? You should be running SSMS R2 SP1. It has fixes for the DAC PAC specifically.
Here it is: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26727

According to Microsoft, there is apparently some kind of issue around which order you install VS 2010 SP1 and SQL 2008 R2 SP1.
Herve's answer may address the problem as well (i.e. reinstall SQL 2008 R2 SP1), but I was not able to verify it because I already solved the issue by following the SQL Azure team's recommended solution - go to http://www.microsoft.com/download/en/details.aspx?id=26728 and download / install the new SMO MSI (which is listed as 1033\x64\SharedManagementObjects.msi).
Thanks MS!

Related

Apply SQL Server schema after 'schema compare' show error

Versions in use:
SQL Server 2016
Azure Data Studio 1.36.2
SQL Server Schema Compare 1.13.1
Problem: there is something wrong with my Azure Data Studio apply schema to SQL Server 2016.
It say I'm not the login manager but there is no login manager role in SQL Server.
And it has worked before updating Azure Data Studio to v1.36.X
https://imgur.com/a/JFWFOtn
Finally, I found the problem
Misused sqllinlinetablevaluedfunction and sqlmultistatementtablevaluedfunction
In my project There are many function use sqllinlinetablevaluedfunction instead of sqlmultistatementtablevaluedfunction but It's should be used sqlmultistatementtablevaluedfunction
so I change to Correct Type then It's worked. The error never show

SQL Replication Publisher thinks Subscriber is wrong version

I have two SQL Server 2008 instances, one running Workgroup Edition (publisher) and the other Standard (subscriber)
I am trying to replicate a database but I am getting errors when it tries to create the database at the subscriber because it thinks it is running SQL Server 2005 for some reason.
Has anyone had this issue before?
I am getting this error
Column Location in object Members contains type Geography, which
is not supported in the target server version, SQL Server 2005.
Have you checked compatibility mode for the databases?
For example:
SELECT compatibility_level
FROM sys.databases WHERE name = 'YourDBName';

Master table node missing , SQL Server 2012 SP1

I've installed Microsoft SQL Server 2012 Express with SP1 (with all the "Cumulative Update #6 for SQL Server 2012 SP1")
Can't view any "table node" on System database under “master” in the Management Studio.
Note : there is a post here that point to another link (MS id : 773184), but is confusing.
Appears is a bug "solved" but still the same problem...
Please advice
Master Table Node missing
http://connect.microsoft.com/SQLServer/feedback/details/773184/ssms-system-databases-node-does-not-show-tables
SP1 CU#7 is out. Try to update and check.
http://support.microsoft.com/kb/2894115

Cannot open properties window and cannot attach database SQL 2008

This is the scenario of the network. The main server/instance is using SQL 2012, and I want to connect to database using SQL 2008.I can login, run a query but the problem is I cannot open any dialog/window like properties and attach database.
This is the error:
TITLE: Microsoft SQL Server Management Studio
Cannot show requested dialog.
ADDITIONAL INFORMATION:
Cannot show requested dialog. (SqlMgmt)
Index was outside the bounds of the array. (Microsoft.SqlServer.Smo)
Program Location:
at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.AllocateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider, CDataContainer dc)
at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.Microsoft.SqlServer.Management.SqlMgmt.ILaunchFormHostedControlAllocator.CreateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()
===================================
Index was outside the bounds of the array. (Microsoft.SqlServer.Smo)
Program Location:
at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
at Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()
at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()
at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.LoginCollection.get_Item(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateLogin..ctor(CDataContainer context)
Hoping for your help! Thanks
That is correct. You can connect from SQL Server Management Studio 2008 to instance of SQL Server 2012 but your options will be very limited - basically to writing queries. You can't use most of SSMS features.
You have two options here:
A - Attach the database using query. MSDN link and example:
EXEC sp_attach_db #dbname = N'DatabaseName',
#filename1 = N'D:\SQL\Data\DatabaseName.mdf',
#filename2 = N'E:\SQL\Log\DatabaseName.ldf';
B - Install SQL Server Management Studio 2012. Express edition is available for free, and you don't need to install the database engine, you can just install the SSMS.
EDIT: There might be a third option. I can not guarantee, but applying latest SP and updates to your 2008, might make it work with 2012 instance with full features.
Still, I would recommend installing SSMS 2012 to work with. It works fine with older instances.

MS SQL Server 2008 "linked server" to Oracle : schema not showing

I have a Windows 2008 Server (x64) running Microsoft SQL 2008 (x64) and I'm creating a Linked Server connection to an Oracle server. I'm able to make the connection, but I cannot see any information regarding which schema a table belongs to.
In SQL 2005, my linked servers show the schema information as I would expect.
Does anyone know how to resolve this issue? Is it an issue with the provider, OraOLEDB.Oracle?
Any help or pointers would be appreciated.
#Boojiboy - When you are looking at the tables via a linked server, there used to be a column for what schema. It appears that in the latest the new Oracle OLEDB drivers don't show this information any longer.
It looks like sp_tables_ex will do the trick, it came from the below article.
--verify tables OK exec sp_tables_ex #table_server = 'LINKED_ORA',
#table_schema='MySchema'
#table_schema is optional. If not
provided, you will get a list of all
tables in all schemas.
http://it.toolbox.com/blogs/daniel-at-work/linking-sql-server-2005-to-oracle-26791
Also in the SQL 08 > Server Objects > Providers
make sure your OraOLEDB.Oracle provider is allowing inprocessing