Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [Atyrau]
- GO
- /****** Object: StoredProcedure [dbo].[pInsertSendDataStatuses] Script Date: 09/07/2012 11:05:36 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- ALTER procedure [dbo].[pInsertSendDataStatuses]
- @ImportSession_ID int,
- @CollectedData_ID int,
- @SendStatus_ID int
- as
- set nocount on
- declare
- @SendDataStatus_ID int,
- @NewCheck_Date date
- insert into
- dbo.SendDataStatuses
- (
- ImportSession_ID,
- CollectedData_ID,
- SendStatus_ID
- )
- values
- (
- @ImportSession_ID,
- @CollectedData_ID,
- @SendStatus_ID
- )
- set
- @SendDataStatus_ID = scope_identity()
- if (@SendStatus_ID not in (0,5))
- --and not exists
- -- (
- -- select
- -- 1
- -- from
- -- dbo.PhotoChecks pc (nolock)
- -- inner join
- -- dbo.CollectedData cd (nolock)
- -- on
- -- pc.Task_ID = cd.Task_ID
- -- where
- -- cd.CollectedData_ID = @CollectedData_ID
- -- )
- --and not exists
- -- (
- -- select top 1
- -- null
- -- from
- -- dbo.CollectedData (nolock)
- -- where
- -- CollectedData_ID = @CollectedData_ID
- -- and isnull(Photo_Exists, 0) = 1
- -- )
- begin
- set
- @NewCheck_Date = getdate();
- execute dbo.pDeclineChecks @SendDataStatus_ID = @SendDataStatus_ID, @NewCheck_Date = @NewCheck_Date
- end
Add Comment
Please, Sign In to add comment