How can we help you today? How can we help you today?

Role and Schema creation out of order

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:
<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
0

Add comment

Please sign in to leave a comment.