Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @CompressionDueDateAdjustment INT
- IF (SELECT COUNT(*) FROM ManEx.dbo.ProjectTypes WHERE Name = 'Compression') = 1
- BEGIN
- SET @CompressionDueDateAdjustment = (SELECT defualt_due_date_adjustment FROM ManEx.dbo.ProjectTypes WHERE Name = 'Compression')
- INSERT INTO ManEx.dbo.Documents ( unit_id, date_na, due_date_adjustment, DocumentType_ID )
- SELECT ManEx.dbo.Books.unit_id, 0, @CompressionDueDateAdjustment, (SELECT DocumentType
- FROM ManEx.dbo.Books
- WHERE (((ManEx.dbo.Books.unit_id) Not In (select unit_id from ManEx.dbo.Documents)));
- END
Add Comment
Please, Sign In to add comment