Red Gate SQL Compare vs. VS2010 Ultimate - sql-server

I used to use SQL2000 and Red Gate SQL Compare 3.2 and I was a happy camper. I wouldn't worry about tracking the changes that I make to the dev database until all the coding was done and I needed to compile a list of scripts to bring the prod db in sync with the prod.
This is where SQL Compare and to some degree, SQL Data Compare, were invaluable in
pointing out the differences and even more importantly,
helping me generate the SQLs to bring the prod db in sync with the dev db.
I see that VS2010 Ultimate allows me to compare two schemas, but does do #2? I believe it is suppose to but it ain't obvious to me how to do that.
Any kick in the right direction would be an immediate vote up or better. ty.

Yes, it does (2). To achieve this, run the comparison (Data/Schema Compare/New Schema Comparison), choose the objects you want to update, and then right click on the grid or go to the Data/Schema Compare menu and select Refresh Update script. If you can't see an upgrade script now, select Show Schema Update Script which is in the same menu.
If you want a more user-friendly and versatile tool, please consider trying SQL Compare 8! (I'm the product manager)

Caution plug,I wrote a blog entry to compare SQL Data in VS2010 Ultimate and Premium that you might wanna check out http://zubairdotnet.blogspot.com/2010/07/fun-with-vs2010-ultimate-comparing-sql.html

As far as I can tell, this tool in VS2010 Ultimate will only work with SQL Server 2005 and 2008. I tried yesterday to do a compare between my production SQL 2000 instance and a dev 2008 instance, and it flat-out said it will not work with anything prior to 2005. RedGate Compare, of course, had no issues at all.

Drop every thing, and try SQL Server Data Tools October 2013 release for Visual Studio 2012: http://msdn.microsoft.com/en-US/data/tools.aspx, choose 'Get It' and then 'Download SSDT for Visual Studio 2012', or you can go straight there on:
http://msdn.microsoft.com/en-us/jj650015
It has Schema Compare and Data Compare, and even allows SQL Server 2014 CTP2 connections.

Related

How to debug T-SQL with SQL Server Management Studio 2017?

The latest changelog (18.0 Preview 7) of SQL Server Management Studio announced, that the T-SQL Debugger is deprecated.
What are the alternatives for the future? Can someone understand this decision? I fear that removing a fundamental development tool like this will effect many developers.
You just need to download the Visual Studio 2019 Community.
Once you've done that, create a new project and open the SQL Server Object Explorer (CTRL + S).
You will be able to see your list of SQL Server databases, just as you did in SQL Server Management Studio.
Finally, left click one database and select "New Query". Now you can debug T-SQL just as you did in SSMS.
But the debugger does not work with Azure SQL
It seems that Microsoft may have temporarily moved the branch of debugging
from
SSMS18 to SQLServer Data Tools (SSDT).
According to developers of DBA Stackexchange community, there is
another alternative way to debugging, since Debugger is deprecated in
SSMS18.
Here is the link that shows how to achieve debugging : How to add the Debug
button to
SSMS v18?
ALTERNATIVE: ??
Just when I thought there would be no solution to this coming out any time soon, to my surprise there might be one.
There is a tool that I've come across lately while dabbling into this
debugger thing in SSMS18 out of curiosity, which goes by the name SQL Complete.
The company Devart apparently specializes in Database products and provides toolsplug-ins for various major databases.
Here is a small video of them briefing about the debugging feature in their tool SQL Debugger in the new version of dbForge SQL Complete
It's available on Visual Studio Marketplace.
#dens is correct by going to visual studio community edition however this is half of the answer as table variable values cannot be inspected and have the placeholder as (table); This is due to Microsoft not finishing this portion of the debugger. Currently, you can only see primitive data types outputted within the Locals Tab.
The work around to see table variables when they are deleted, updated or inserted into is to utilize the output keyword with each query to output the inserted or deleted elements. Now when you step through you will see the primitive variables within the debugger logger tab called "Locals" and the table variables within the Results or T-SQL tab as you step through. unfortunately the variable name will not be next to the output however as you step through, its pretty clear which table output belongs to which variable
Furthermore, if you are debugging a stored procedure on a SQL database not on your local database, i recommend backing up a local version of the database with the developer edition of SQL server since attaching a debugger to the query will get blocked by the firewall. Then you will require sysadmin privileges and open ports which may work however it did not work within my workplace. we tried even dropping the entire firewall and nothing but good luck.

Red Gate's SQL Toolbelt or Quest's Toad for SQL Server?

We are evaluating trial versions of Red Gate’s SQL Toolbelt and Quest Software’s Toad for SQL Server. What are the main differences between these tools? The benefits of using these tools are quite obvious but we are wondering which one is more suitable for a developer and development work? Is Toad for SQL Server more focused on DBA work?
Toad for SQL Sever basically is an alternative to SQL Server Management Studio - it gives you insights into your server, databases, database object etc. and you can execute queries and explore your data. But that's about it.
Red-Gate's Toolbelt is a totally different set of tools - a toolbelt, as the name implies:
compare databases for structural or data-related differences
determine dependencies between database objects
greatly superior intellisense for SSMS and Visual Studio
package database changes into an update package (EXE or .NET assembly)
and a lot more
I don't think TOAD offers any of those capabilities, so you're really comparing apples to carrot or something here.
I can totally recommend Red Gate tools - I'm using SQL Prompt, SQL Search, SQL Compare, SQL Data Compare and SQL Packager regularly, and they just do their job in a great way. Highly recommended!
The tools from RedGate are spectacular. I don't know about Quest's Toad, but you cannot go wrong with RedGate. In fact I often end up using their products as fodder for requirements on new features for my unrelated products.
They quickly respond to questions, provide intelligent assistance, and, well, if I could marry Redgate I would get down on one knee right now.
'nuff said?
Toad, has a free "community version" 6, which indeed offers intellisense, dependencies and other things.
There are 3 levels of paying versions and they have comparison tools + many extras which I could not evaluate since I am only using the free version.
Anyway, since I started using Toad I nearly never go back to SSMS...except for the free RedGate SQL Search, which is a real time saver in some situations.

Restore SQL Server 2008 database to SQL Server 2000

I have to move an entire database from a SQL Server 2008 machine to a SQL Server 2000 machine.
I created a backup using Management Studio 2008, copied it to the hard drive of the 2000 box, and from withing Management Studio 2008, I choose Restore Database to the 2000 box.
I get an error message stating, "The media family on device ... is incorrectly formed. SQL Server cannot restore this media family".
If I use Enterprise Manager 2000 I get the same error.
Is there a way to move a whole database from the newer SQL server to the older?
The only thing I can think of is to recreate the whole structure and then copy data from a live database. So, create scripts that will create the tables, views, and sp's, and then create scripts to copy the data from the existing database.
As others already said there is no default way to do this. It’s just not supported. Here are more extensive details on how to do this properly and avoid any migration issues.
You need to generate scripts for structure and data and then execute these on SQL 2000 (like others already said) but there are couple things to take into account.
Generate scripts in SSMS
Make sure to check option for scripting data for SQL 2000 to avoid issues when trying to create something like geography type column on SQL 2000.
Make sure to review execution order of scripts to avoid dependency based errors
This is a great option for small to medium size databases and requires some knowledge of SQL Server (dependencies, differences between versions and such)
Third party tools
Idea is to use third party database comparison tools such as ApexSQL Diff or Data Diff
Good side is that these will take care of script execution and differences between versions
Not so good is the fact that you’ll need to pay for these after trial ends
I’ve used these two tools successfully but you can’t go wrong with any other tool on the market. Here is a list of other tools in this category.
you can't move backups from a newer version to an older, in that case you can script your database, execute it in the 2000 box, then you can use the standard data transfer to transfer any data you want
Provided you have a network connection between the machines use SSIS. Much easier and a lot less messing around.
You can use Script Generator for your database and then select in the properties form : General-> Script for server version : SQL Server 2000.
The script generator will show you things which not compatible with your server version.
I've heard you can only do it by generating the SQL statement dump from the DB administrator tool and re-running those queries on the target older database.
You can generate a script that will recreate all the objects and transfer all the data...as long as everything in the db is valid in SQL 2000. So no ROW_NUMBER(), no PARTITION, no CTEs, no datetime2, hierarchy or several other field types, no EXECUTE AS, and lots of other goodness. Basically, there's a pretty good chance it's not possible unless your db is pretty basic.
We got a similar situation. A very low-tech but handy solution is:
backup and truncate the tables in SQL 2000.
create a LINKED server in SQL 2008, pointing to SQL 2000
run a select query at sysobjects to generate a query script for insert into LINKED SERVER.table select * from table
execute query script.

Tools to generate SQL DDL and Content from an existing database

Does anyone know of a reasonably priced tool that will create DDL statements to create a SQL Server database and appropriate Insert statements to recreate the data? I use the Red Gate tools to do database compares (including content compares) and this comes close (I could always compare with an empty schema) but I was wondering if there was a tool that others found useful that did this in one step.
Late answer... hopefully someone will find it useful…
There is a tool from Red Gate called SQL Multi Script that can do scripting for what you need. Not sure if it existed when the question was asked though :)
Another good piece is SQL build tool from ApexSQL which can also do all kind of insert and other scripts…
Disclaimer: I’m not affiliated with any of the companies mentioned above.
Have you had a look at SQL Publishing Wizard? It will create all the DDL statements you require for all database elements (tables, views, SPs, users etc).
If you're using SQL 2008, it comes built into the management studio. More info on 2008.
SQL Publishing Wizard
Saw Austin Solonen post this tool in a somewhat related thread. Express editions appearantly don't hove Import and Export.
The database publishing wizard that is included in Visual Studio 2008 performs this function.
It is also available via CodePlex as an add-on for prior versions of Visual Studio.

Fast SQL Server 2005 script generation

It seems like the generation of SQL scripts from the SQL Server Management Studio is terribly slow. I think that the old Enterprise Manager could run laps around the newer script generation tool. I've seen a few posts here and there with other folks complaining about the speed, but I haven't seen much offered in the way of alternatives.
Is there a low-cost/free tool for scripting an entire SQL Server 2005 database that will perform better that SSMS? It would be hard to do worse.
See the Database Publishing Wizard that is part of the SQL Server Hosting Toolkit. It generates a single SQL file for both schema and data.
We are using the tools by RedGate which I personally find very useful in any aspect of work with databases. For scripting I would recommend the SQL Compare (you need a pro version for scripting). The SQL Compare is a must have for deploying schema changes from the deployment DB to the live Server and a real timesaver.
Those tools are not free but I think they could save you money in a long run
What kind of scrpt generation are you talking about now?, generating create scripts from the objects in the database is way faster in SSMS compared to EM.
But if you are running an select or something that gives you lots of rows in the grid, it is crazy slow.. like scripts generating inserts statements of all rows in an table, if you got lots of data, it is almost not doable.
I don't know what is "terribly slow" for you, but I have a decent performance with SQL 2005 Management Studio. In either case, RedGate products are very cool. Unfortunately they are not free.

Resources