options for comparing datamodels between 2 databases? - sql-server

I need to identify the datamodel differences between 2 databases: DB1 and DB2. I need a way to identify missing/extra database objects and naming differences. Is there a sproc or free tool that you can recommend for this purpose?

To compare between two database schema, you can use visual studio 2015. Please follow the following steps.
Open the visual studio 2015 IDE.
Go to the tools menu according to the following image.
Then select source and destination database as per following image.
Then compare button and see the changes between source and destination database according to the following image.
After clicking update button, your destination database schema will be changed as per source database.
Thanks.

Related

How to solve Acumatica SQL Error After Upgrade

I'm trying to update my client's Acumatica ERP to the latest version. I cloned the current instance to test drive the update procedure and make sure everything runs smoothly. They are currently using version 2019 R2 and want to update to 2020 R2.
Using the test instance, I updated it to the latest build of 2020 R2 and everything seems to be working except for one report. When I try to generate the Report I'm getting the following error.
I imagine this has to do with a change in the Database. However I can't find a table with that name either in the new database or in the current database. I'm not sure if that's table, store procedure, view, etc. I'm not very familiar with SQL.
I loaded the report in the report designer and try looking at the schema but couldn't find any reference to that particular table.
Any help would be greatly appreciated.
Regards.
CES
The SOAdjust table must exist in the database.
Please, try again with the following steps:
Create a snapshot of the client system.
Create a new system on the same version
Download and restore the snapshot created on the 1 point.
Download and install Acumatica 2020R2 ERP Configuration
Open the Acumatica ERP Configuration.
Select the system
For the upgrade procedure
7.1 Click the Update Only Database
7.2 Click the Update Only Website
In Acumatica 2019R2, the SOAdjust table is in two different namespaces.
PX.Objects.SO.SOOrderEntry.SOAdjust
PX.Objects.SO.SOAdjust
In Acumatica 2020R2, the SOAdjust table is in only one of them
PX.Objects.SO.SOAdjust
I think you should update the SOAdjust table in the report.
"view the namespaces in SQL Management Studio" - You don't. Namespaces are from .Net, and have to do with the code organization (crude description, but close enough for understanding). At a SQL level, the Acumatica structure is quite flat, just tables in the database (VERY few fancy sql tricks / sql level organization), all the "Real" logic tends to be in the business objects (Graphs, for the most part, though some interesting logic is within the DAC (data object classes))

Migrate data from Sql Database to SharePoint list and libraries

Need to migrate data from Sql tables to SharePoint 2013 lists. The database size is approximately 80 GB and need to move the contents from Sql tables to SharePoint lists with same schema.
Just want to know if there is any tool available for this. Or do we need to create an application (probably in .net) to fetch data from Sql and write back to SharePoint lists.
Any suggestions.
Try to see this article:
How to: Create an External Content Type Based on a SQL Server Table
In addition, see CodePlex, if you will use SSIS to perform the exportSharePoint List Source and Destination in the Microsoft SQL Server Community Samples: Integration Services project on CodePlex.
Using current toolchain you may consider using this path:
Open Excel
Add a data connection to your SQL Server
Import all data you want to have as a SharePoint list - you got a sheet now
Save as *.xlsx file
Go to SharePoint 365, select "New List"
Choose "Import from Excel" in the "New" dialog
There appears a sheet preview where you can adjust column types (most likely needed)
Click "Next", give the list a name (you may need to remove the silly Guid attached to the generated name, apart from this the name is the table name)
Click "Create"
Done
For a single table with roughly 800 records it takes 2 mins approx.

How to export a Table's schema to another Database?

I have 10 tables in my database. Out of this I want to generate 5 tables with same structure and dependencies in a different database. I don't need to copy the data inside these tables, just the schema of tables. How do I do this? I don't want to manually copy the code but to generate files to export.
If you are copying from database(Schema) in SQL Server to another, then what you can do is use the Tasks>Generate Scripts
From here you press the Select Specific Database Objects and select the tables in the tables section that you want to carry to your new database.
Then go to the Set Scripting Options Menu, and press the advanced button at the top right of that menu. Another menu will pop up with options. Based on what you said the default (following) options should work.
Then Just Generate it in your desired format and make sure you're pointing them all to the correct database!
Using SQL Server Management Studio you can right-click on the database in the Object Explorer and choose Tasks/Generate Scriptsand follow the instructions in the wizard.

Create Database Instance from Model

*Seems like there is some confusion. I created a SQL Server Compact Edition file and can see it from the Server Explorer. I can also right click and add tables manually. What I want to do is run the generated sqlce file to add all of the tables and columns from my model to the SDF.
-- background --
In Visual Studio 2012 (Ultimate), I designed a model using the model designer. It created an edmx file. I right clicked the model and chose "Generate Database from Model..." and created an sqlce file. My understanding is that I should be able to execute this file on an sdf somehow to create a SQL Server Compact Edition Instance of my database. I don't see the option on right click to execute the sql code, and the other option is to "Run SQL Scripts in Solution Explorer" which doesn't seem to make sense.
http://msdn.microsoft.com/en-us/library/yea4bc1b.aspx It says to drag the sqlce file to a database reference, but I'm not really sure what they mean. I have tried to drag it to the server explorer where the sdf is connected.
I tried right clicking on the sdf in the Server Explorer to do New SQL Query and pasting the sqlce in, but it seems that Create Table isn't supported.
Any ideas?
Generate Database from Model... only generates tables and relationships.
You need to have a database created already, and have it in the Database References folder. Then you drag your script file to that database reference, as described in your mentioned link.

Generating SQL change scripts in SSMS 2008

I have gone through many related SO threads and got some basic info.
Already generated DB diagram.
After that i am unable to find a button/option to generate SQL scripts (create) for all the tables in diagram.
"Generate script" button is disabled, even on clicking the table in diagram.
However i enabled the auto-generate option in tools->designer. But what to do with previous diagrams.
I just want an easy way to auto-generate such scripts (create/alter) and would be gud if i get auto-generated stored procs for insert/selects/update etc.
EDIT: I could do generate scripts for DB objects.
Now:
1. How to import DB diagram from another DB.
2. How to generate (and manage their change integrated with VS source control) routine stored-procs like insert, update and select.
Ok let me ask another way, can experts guide on the usual flow of creating/altering tables (across releases), creating stored-procs (are stored-procs the best way to go ?) and their change-management using SSMS design tools and minimal effort ?
You can go to the Object Explorer in SSMS, and right-click on your own database, and then pick "Tasks" > "Generate Scripts" to generate a whole bunch of scripts for your database.
Mind you - this is just a single set of CREATE statements, basically.
If you're using the visual table designer to modify your tables, you can also have it create a script to handle the changes you've made.
And in Visual Studio 2010 Professional or up, you can also take snapshots of databases, and compare two sets of your database and generate ALTER scripts from those .

Resources