Remove tempdb..sysobjects from Compare Script

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Remove tempdb..sysobjects from Compare Script

Postby erenken » Mon Aug 26, 2013 10:39 pm

Is there a way to have the engine not create this line in the output script?

GO
IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id=OBJECT_ID('tempdb..#tmpErrors')) DROP TABLE #tmpErrors
GO

We want to make our resulting scripts work on local servers and Azure and this is keeping it from working. As Azure doesn't like that line and that is why I assume you don't create it when you are going against an Azure DB
erenken
 
Posts: 4
Joined: Fri Jun 02, 2006 11:49 pm

Postby Brian Donahue » Thu Aug 29, 2013 11:54 am

Hello,

You're right - SQL Compare would probably filter this out if you were comparing directly to Azure. I think you can avoid this line by using the "Do not use transactions in deployment scripts" option.

However, there are numerous exceptions in the SQL Compare code for Azure because in a lot of ways it doesn't work the same way as shrink-wrapped SQL Server. Comparing SQL to SQL and applying the script to Azure is not guaranteed to work.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest