use @DBNAMEYEAR

if not exists (SELECT name 	  FROM 	 sysobjects 	  WHERE  name = N'pageLog' 	  AND 	 type = 'U')
begin 
begin tran createPageLog
 

CREATE TABLE [dbo].[pageLog](
	[requestID] [int] IDENTITY(1,1)  PRIMARY KEY  NOT NULL,
	[pageType] [int] NULL,
	[pageNo] [int] NULL,
	[registerDate] [char](10) COLLATE Arabic_CI_AS NULL,
	[perno] [char](@pernoLenght) COLLATE Arabic_CI_AS NULL,
	[comment] [nvarchar](500) COLLATE Arabic_CI_AS NULL,
) ON [PRIMARY]

if @@ERROR > 0 
  rollback tran createPageLog	
commit 

end
