Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
1| Name | Data Type | Length | Description |
|---|---|---|---|
| @user_ID | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.GET_CONTRAVENCIONES
@user_ID INT
AS
BEGIN
SET NOCOUNT ON;
update contravenciones set user_procesamiento = @user_ID
where id_contravencion in (
select top 1 id_contravencion from contravenciones
where procesado = 0 and fecha_procesamiento is null and user_procesamiento is null
or (procesado = 0 and fecha_procesamiento is null and user_procesamiento = @user_ID)
order by id_contravencion asc)
select * from contravenciones
/*WHERE (id_contravencion = 57)*/
where procesado = 0 and user_procesamiento = @user_ID
order by id_contravencion asc
END
GO
GO
CREATE OR ALTER PROCEDURE dbo.GET_CONTRAVENCIONES
@user_ID INT
AS
BEGIN
SET NOCOUNT ON;
update contravenciones set user_procesamiento = @user_ID
where id_contravencion in (
select top 1 id_contravencion from contravenciones
where procesado = 0 and fecha_procesamiento is null and user_procesamiento is null
or (procesado = 0 and fecha_procesamiento is null and user_procesamiento = @user_ID)
order by id_contravencion asc)
select * from contravenciones
/*WHERE (id_contravencion = 57)*/
where procesado = 0 and user_procesamiento = @user_ID
order by id_contravencion asc
END
GO
Depends On
1Used By
No items found