CREATE TABLE TCApplicationAttachments
(
	TCApplicationAttachmentID	int IDENTITY(1,1),
	TCApplicationID		int NOT NULL,
	AttachmentName		nvarchar(200),
	AttachmentDate		datetime,
	AttachmentScan		image,
	AttachmentTypeID	int,
	FileExt 		nvarchar(100),
	PRIMARY KEY (TCApplicationAttachmentID)	
)
GO
exec sp_addextendedproperty 'MS_Description', N'Документы-приложения к Заявке на технологическое присоединение', 'user', 'dbo', 'Table', 'TCApplicationAttachments'
exec sp_addextendedproperty 'MS_Description', N'Код документа', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'TCApplicationAttachmentID'
exec sp_addextendedproperty 'MS_Description', N'Код заявки', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'TCApplicationID'
exec sp_addextendedproperty 'MS_Description', N'Наименование прилагаемого документа', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'AttachmentName'
exec sp_addextendedproperty 'MS_Description', N'Дата прилагаемого документа', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'AttachmentDate'
exec sp_addextendedproperty 'MS_Description', N'Скан документа', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'AttachmentScan'
exec sp_addextendedproperty 'MS_Description', N'Тип документа', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'AttachmentTypeID'
exec sp_addextendedproperty 'MS_Description', N'Расширение файла для вложенного документа', 'user', 'dbo', 'Table', 'TCApplicationAttachments', 'Column', 'FileExt'
