Visual Studio Data Compare Msg 3727 - sql

I tried to do data compare with Visual Studio 2012 but got 1 critical error. I was able to to do the comparison between these 2 db before I was forced to update the data compare since I am comparing with another db using SQL 2014. My latest SQL Server Data Tools ver is 11.1.40403.0
Please see below for the screen shot. Has anybody encounter this before and has solution? I am stuck as data compare doesn't has any option to select to bypass constraint check or whatsoever.

Problem is solved automatically after restart PC.

Related

Migrating legacy data from SQL Server 2000 to 2019 , log block error - is there a painless way of moving over tables with autoinc identity columns? [migrated]

This question was migrated from Stack Overflow because it can be answered on Database Administrators Stack Exchange.
Migrated 5 days ago.
I've been tasked with migrating data from an instance of SQL Server 2000 to 2019. There are a total of four databases to bring over, three of which I was able to backup/restore into 2008 and then into 2019 without any issues. Please note: I am not a DBA in any sense, though I'm the closest thing to one on hand.
The fourth and final database presented the following error that prevented moving from 2008 to 2019:
System.Data.SqlClient.SqlError: An error occurred while processing the log for database 'DbNameHere'. The log block version 2 is unsupported. This server supports log version 3 to 6. (Microsoft.SqlServer.SmoExtended)
Is there a simple fix for this problem that I'm missing in the various SSMS menus?
Alternatively, is there a way to copy raw data from one server to another via, for instance, a flat file, and preserve the identity columns as identity columns? That is, I don't want to just strip that column and bulk insert, as they are often used as foreign keys in other tables, and with twenty-some-odd years of data, something is bound to break in doing this.
An example of an ideal final result in this solution would be something like: legacy table X has 1000 rows, the last of which has an identity column value of 1000. Once the move is complete, new table X has 1000 rows, the last of which has an identity column value of 1000, and upon insert the next row automatically increments to 1001.
Apart from unsuccessfully messing around with flat files, I've also tried the "Copy Database" option in SSMS, which also failed.
I would attempt to get SQL Server to rebuild the transaction log. Based on the error message, that might sort out the situation.
You first use sp_detach_db to detach the database. It is now very likely that the ldf file isn't needed when you do a subsequent attach, and perhaps rebuilding the log this way will sort the situation.
Then you attach the database, without the ldf file. Use CREATE DATABASE with either of the FOR ATTACH or FOR ATTACH_REBUILD_LOG options.
I would do this on the 2008 instance, since from what I understand you got the database in there successfully. But feel free to play around regarding on which version (2000 or 2008) you do the detach and also on which version (2000, 2008, 2019) you do the attach.

visual studio 2019 schema compare no differences detected

I am using New Schema Comparison to compare 2 Databases
but this tools return " compare no differences detected "
I am using VS 2019
Have a look at the Error List in Visual Studio.
In my case it contained errors, but it's not obvious that an error has occurred from the SQL Schema Compare UI.
I just faced the same problem. In my case, it was because the database user did not have enough privileges.

SSDT schema comparison error: Value cannot be null. Parameter name: identifierGroup

With SSDT in VS 2017 I cannot do a schema comparison of two databases. Steps to reproduce:
Tools >> SQL Server >> New Schema Comparison
Select a source (a SQL 2017 database)
Select a target (a SQL 2017 database)
Compare
Get error: Value cannot be null.
Parameter name: identifierGroup
I've also tried in VS 2015 which was still installed and it failed there too.
This error starts after the identity Cache is disabled
ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = OFF
After re-enabling it, the error disappears:
ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = ON
Don't forget to restart sql service.
I had the same issue and not yet found a solution, I suppose there are some relation with orphan users.
I did a workaround that worked fine to me.
Create a new empty database
Compare the origin database with this new one.
Update the new database with de resulting script.
Make this new database the new origin and compare with the destination database.
Update de destination database.
Maybe this can helps!
I found a different answer which worked for me several times so far using SSDT / Visual Studio 2019 against SQL server 2019 databases.
https://hendrikbulens.com/2018/10/03/how-to-fix-sql-server-data-tools-error-unexpected-exception-caught-during-population-of-source-model-in-visual-studio-2017/
Hope this helps someone. Ideally Microsoft needs to patch this issue, which looks like a longstanding bug at this point. I looked for such a patch but did not find one. If anyone finds one, please do link it here.

SQL Server 2012 intellisense works for first query in a window

My problem is that when I write a query in sql server on a sheet I get intellisense for the first query and only the first.
If I was to write a query directly below the first, I get no intellisense at all. I could put my cursor back to the initial query and get intellisense once again.
For example, this is a single query sheet:
select t.* from table1 t; --Intellisense, yay!
select t.* from table2 t2; --no intellisense, ;(
What is going on here? I have turned off SQLCMD Mode, I read this will mess up the intellisense, also I have changed the maximum script size around - all to no avail.
Any help would be appreciated, thank you!
the problem is SSMS reads the second query as an error. I know you can comment out the top one and get intellisense on the bottom on. Really sucks when you have a huge server.
if you are working on a remote server you as many people that use SSMS 2012 have to wait a patch from Microsoft.
Otherwise here you can find a list of setup to check.
Best regards,
Danny
One possibility - If you have installed Visual Studio 2010 Service Pack 1 then it will definitely break SQL server intellisense. To resolve the issue install the latest service pack for your SQL server. Read this article here - https://support.microsoft.com/en-gb/kb/2531482

msg102 level 15 error - sql server

I was trying to run a script to create a DB with all the tables and data on a server, which I created using script wizard in SSMS 2008. The destination server is 2005 and since I am unable to just restore a backup, I had to go through this long process which entailed running it through sqlcmd cause it was too large to open in SSMS.
But after running for more than 5 hours, I checked on it and it had the following error:
msg 102 level 15 state 1, incorrect syntax near 'VA'
Now I tried finding the source of the error and looking in the script the only reference to 'VA' are in the data types nvarchar or varchar.
Please help, I really need to deploy this DB.
EDIT
For those who have answered, thanks for the responses. I guess I will have to rerun the script but I would like to know if anyone has any ideas on running the script in SSMS. The script is over 2GB in size since it has to recreate the data and there is no other way to deploy this 2008 DB to a 2005 sql server edition.
Either: you have scripted a SQL Server 2008 only option which can be changed in SSMS (tools..options somewhere)
Or (assuming no other VA strings) the word VARCHAR has truncated to VA. I've had this happen with dynamic SQL: can be a real pain to track down
in SSMS if you double click on the error message in the results pane, it will usually change focus and highlight that line of code. Now, how close that line of code is to the actual error depends on the actual problem, but you should be able to find the line of code it is complaining about.
Really tricky to track these down, but you could either try to generate the script setting the compatibility level for SQL 2005 or use the SQL 2005 tools to generate the script.