if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fsitems]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fsitems]
GO

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fsitems]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
 BEGIN
CREATE TABLE [dbo].[fsitems] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[path] [nvarchar] (300) NOT NULL ,
	[isdir] [bit] NOT NULL ,
	[parentpath] [nvarchar] (300) NOT NULL ,
	[createdt] [datetime] NULL ,
	[filename] [nvarchar] (300) NULL ,
	[filesize] [int] NULL ,
	[filedata] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END

GO

ALTER TABLE [dbo].[fsitems] WITH NOCHECK ADD 
	CONSTRAINT [PK_fsitems] PRIMARY KEY  CLUSTERED 
	(
		[path]
	)  ON [PRIMARY] 
GO

