IF NOT EXISTS(SELECT * FROM sys.sysobjects WHERE name ='UserAccountingCode' and xtype='U')
Begin
	CREATE TABLE [dbo].[UserAccountingCode](
		[Id] [UNIQUEIDENTIFIER] NOT NULL,
		[UserName] [SMALLINT] NOT NULL,
		[AccountId] [INT] NULL,
		[BranchCode] [VARCHAR](3) NULL,
 CONSTRAINT [PK_UserAccountingCode] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)
) ON [PRIMARY]
	ALTER TABLE [dbo].[UserAccountingCode] ADD  CONSTRAINT [DF_UserAccountingCode_Id]  DEFAULT (NEWID()) FOR [Id]

END