Guest User

Untitled

a guest
Jul 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. DECLARE @CompressionDueDateAdjustment INT
  2. IF (SELECT COUNT(*) FROM ManEx.dbo.ProjectTypes WHERE Name = 'Compression') = 1
  3. BEGIN
  4. SET @CompressionDueDateAdjustment = (SELECT defualt_due_date_adjustment FROM ManEx.dbo.ProjectTypes WHERE Name = 'Compression')
  5.  
  6. INSERT INTO ManEx.dbo.Documents ( unit_id, date_na, due_date_adjustment, DocumentType_ID )
  7. SELECT ManEx.dbo.Books.unit_id, 0, @CompressionDueDateAdjustment, (SELECT DocumentType
  8. FROM ManEx.dbo.Books
  9. WHERE (((ManEx.dbo.Books.unit_id) Not In (select unit_id from ManEx.dbo.Documents)));
  10. END
Add Comment
Please, Sign In to add comment