Redgate Sql Compare Alternatives

Redgate Sql Compare Alternatives Rating: 5,0/5 48 votes

Red Gate Sql Compare (sometimes referred to as Sql Compare) was added by cardguy1000 in Sep 2013 and the latest update was made in Nov 2014. The list of alternatives was updated Dec 2018 There is a history of all activites on Red Gate Sql Compare in our Activity Log.

  1. Sql Compare Tables

I've been using the Red Gate SQL Comparison API in a project that's getting long in the tooth. We use a fraction of its abilities and I am evaluating other options.

Our scenario is basically this:

  • We have two SQL Server 2008 databases that can be assumed to have identical schemas.
  • The databases are tiny. Most tables have less than 10K rows; some have less than 100.
  • DB1 can be considered 'primary.' We only make changes to DB1 directly, and those changes are propagated to DB2.
    • A small set of five tables, when modified in DB1, must be replicated to DB2 immediately.
    • Occasionally the entire database — less a set of exclusion tables (e.g. logs) — must be replicated at once, again from DB1 to DB2. This is triggered from a web form.

At the moment all of this is handled in code using Red Gate's SDK to do the dirty work.

How else might I go about this? I'm open to pure SQL Server solutions (replication?) if you think it's the right choice, though a pure C# solution would require a bit less interaction with my IT department, if you catch my drift.

roufamaticroufamatic

3 Answers

The only other programmability product I know of would be ApexSQL's Diff API - Apex SQL Diff is a similar product, and they also publish an API to do these things programmatically in your own app.

I've never used it myself, but I have used (and really enjoyed) other ApexSQL tool - highly recommended.

marc_smarc_s

I know I am a bit late to the party, but I've just released the source code to Atlantis.SchemaEngine - which does the schema part of the DB, and was considering whether to release Atlantis.DataEngine (no prizes for guessing what that does). Is that something that would be of interest? SchemaEngine is here.

Matt WhitfieldMatt Whitfield

You could try using FluentMigrator. It's a database migration library for .NET. You could use it to define your schema in C# and then push changes out to both databases.

Sql
GiddyUpHorseyGiddyUpHorsey

Sql Compare Tables

Not the answer you're looking for? Browse other questions tagged sql-serverreplicationredgate or ask your own question.

I'm in a situation where I would to generate a script for a database that I could run on another server and get a database identical to the original one, but without any of the data. In essence, I want to end up with a big create script that captures the database schema.

I am working in an environment that has SQL Server 2000 installed, and I am unable to install the 2005 client tools (in the event that they would help). I can't afford RedGate, but I really would like to have a database with identical schema on another server.

Any suggestions? Any simple .exe (no installation required) tools, tips, or T-SQL tricks would be much appreciated.

Update: The database I'm working with has 200+ tables and several foreign-key relationships and constraints, so manually scripting each table and pasting together the script is not a viable option. I'm looking for something better than this manual solution

Additional Update Unless I'm completely missing something, this is not a viable solution using the SQL 2000 tools. When I select the option to generate a create script on a database. I end up with a script that contains a CREATE DATABASE command, and creates none of the objects - the tables, the constraints, etc. SQL 2005's Management studio may handle the objects as well, but the database is in an environment where there is no way for me to connect an installation of Management Studio to it.

Michael LangMichael Lang

closed as off-topic by Martijn PietersFeb 12 '17 at 0:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Martijn Pieters
If this question can be reworded to fit the rules in the help center, please edit the question.

10 Answers

Run SQL Server Management Studio, right click on the database and select Script Database as > Create to > file

That's for SQL Server 2005. SQL Server 2000 Enterprise Manager has a similar command. Just right-click on the database > All Tasks > Generate Scripts.

EDIT: In SQL Server 2005, you can select 'Database' in the object explorer pane and select several databases in the details pane. Then, right-click on your selection and 'Script Database as > Create to > file'. This will cause it to put them all into one script and it will include all tables, keys, stored procedures, and constraints.

Cultural anthropology textbooks. Online shopping for Cultural - Anthropology from a great selection at Books Store. Cultural Anthropology. See newer edition of this book. Guest - Cultural Anthropology Course and Anthropology Courses. For Cultural Anthropology 2018, I will use the textbook and reader edited by Kenneth Guest. Find Survey of Cultural Anthropology Textbooks at up to 90% off. Plus get free shipping on qualifying orders $25+. Choose from used and new textbooks or get.

BoltBaitBoltBait

So, I assuming that you cannot install SQL Server Management Studio. Not even the free version. If this is a onetime thing, I would install the red gate tools. The trial version is fully functional for 14 days. Do your work, then uninstall. You might also check out http://www.xsqlsoftware.com/, they have similar functions as Red Gate. If your database is small, then they have a free option for you. I also like http://www.apexsql.com/.Use the trial of one of these and then try again to convince your boss to buy one.

Bobby OrtizBobby Ortiz

In addition to the above answers, I'd like to suggest that (for future projects, at least) you don't have you master database design in the database itself.

One way to achieve this is to either simply maintain your database tables, procedures etc as 'CREATE' scripts from day one, and devise a master script that will pull all of the individual scripts together for deployment to a database of your choosing.

A more sophisticated solution is to use something like Visual Studio Database Edition (Probably too pricey, if your comments are anything to go by) which allows you to treat each database object as a node in a project, whilst still allowing the whole thing to be deployed with a few clicks.

The explanation of both of these options is over-simplified, as there are a lot of other issues - versioning, data migration etc - but the main principle is the same.

Once you've extracted your script - using one of the other answers - you may want to consider using this script as the basis for your 'master'.

Just keep the 'design' out of the database - that's purely for 'implementations'.

Try to think of the process as similar to developing code - the source and the binaries are kept separate, with the latter being generated from the former.

belugabobbelugabob

I have used this program from CodeProject successfully many times before. Not only does it script out the schema, it can (optionally) script out all the INSERT statements you will need for recreating the database.

I've used it against SQL Server 2000 in the past. Obviously if you have a million rows in a table it might not be a good idea to script out the contents but it's a really neat tool actually to make a series of SQL scripts to replicate a database.

Tom KiddTom Kidd

If it is one-off operation and you do not fancy ordering the object scripts yourself just download a free trial version of RedGate SQL Compare.

It is 14 days full working version so it will do the entire job for you – it is completely legitimate solution. And you will have all the scripts for the future use with your manual scripting. Anyway I am pretty sure that if you find out how handy the tool is you will buy it in some later stage and that is what they probably hope for by offering fully working trial. It somehow worked in that way in my case.

Just be aware that once the trial expires it affects all the tools so make sure to make the most of it.

kristofkristof

Michael Lang, when you right-click on the database and choose to create a script, there are several options boxes that you will need to click in order for everything to be generated. 2005 is much easier in this respect, but 2000 can do this, you just need to select the proper options.

BoltBaitBoltBait

If you're looking for a command line version, Sql Server Hosting Toolkit has worked for me in the past.

Richard NienaberRichard Nienaber

Microsoft Database Publishing Wizard (in Visual Studio 2008).

Redgate sql data compare

As you mentioned in SQL Server 2000 the command to use is:

Reformat portable hard drive windows 10. While in Enterprise Manager select the database you want to script objects from and then Right Click and select All Tasks -> Generate SQL Scripts..

While in the Options Pane it is handy to select option Create one file per object it that way you can store each object in source control separately.

So then whenever you do some updates on a tableA you can check it out in source control to let others know that you work on it and the after you finish you can script that single object and save check it in.

To script a single object you can you the same option All Tasks -> Generate SQL Scripts.. and then select just that one object.

The only problem with that approach is when you want to restore the complete database you need to take care of dependent objects in the sense that the top level object must be restored before the ones dependent on them.

Ironically when you script the whole database to one file the objects are not ordered in terms of dependency but rather based on the creation date. That leads to errors when you try to use it to restore the complete DB.

We ended up creating batch file that would create each object separately calling 'osql '

And that all worked pretty well at that time

Now we use SQLCompare Pro and it safes us from or that hassle, but if you do not make release frequently you can live without it.

kristofkristof

The others are correct, but in order to create a full database from scratch, you need to create a 'device' in SQL before you run the create tables, and procedures scripts..

Use ADODB, since just about every (if not every) Windows box has it installed to execute the script.

Hell, you could even write a vbScript that executes to build your entire database. Any domain tables you have, you need to remember to turn on the identity insert before you add the items to the DB.

I'm open to source code sharing if you need it. I had to write the very same thing a couple years ago, and ended up with 3 scripts, one that created the device, then the tables, then the procedures/triggers and domain data. I wrote the code to parse the default script and allow the user to name his own database, and logins, etc. You may not have to go that far.

Hope this helps at all.

LarryFLarryF
Sql

Not the answer you're looking for? Browse other questions tagged sql-serversql-server-2000sqltools or ask your own question.