Role and Schema creation out of order

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

Role and Schema creation out of order

Postby brass » Wed Aug 08, 2012 4:52 pm

SQL Compare scripted the schema and role creation out of order. Below is a snip of the beginning of that script. I was using SQL Compare 10.1.0.102 and comparing script folder --> SQL 2008R2 database. Also, I can see that Role creation doesn't have the error check found after all the other actions... though I'm not even sure if a role can be rolled back as I havn't tested. I'm not sure where to report this so here it is:

Code: Select all
<snip>
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
GO
PRINT N'Creating schemata'
GO
CREATE SCHEMA [ods]
AUTHORIZATION [ods]
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
PRINT N'Creating role ods'
GO
CREATE ROLE [ods]
AUTHORIZATION [dbo]
GO
PRINT N'Creating [ods].[xyz]'
GO
CREATE TABLE [ods].[xyz]</snip>
brass
 
Posts: 1
Joined: Wed Aug 08, 2012 4:38 pm

Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest