sql Compare
Damdoar
Posts: 2
i am comparing database1 and database2. now i want to script out a stored procedure, so that if i run that stored procedure in databse2 the two databases should be the same.how i can do this with sql compare or i need to download some other software form red-gate?
Comments
Thanks for asking, but I'm a bit unsure what you need to do. Is it that you need a script for only one of your stored procedures, or that you want to permenantly create a stored procedure in the database that migrates all of the schema without the need to compare the databases with SQL Compare?
The first requirement would be easy to meet, by de-selecting all of the objects in the comparison results window, then selecting only the stored procedure and clicking on synchronize.
The second idea isn't possible really. But you could use the command-line version of SQL Compare (sqlcompare.exe) if you want to automate a comparison. If your security was relaxed enough, I suppose you could use SQL Server's xp_cmdshell extended stored procedure to run sqlcompare.exe from inside SQL Server and then wrap that code up into a stored procedure script of your own.