You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
884 B
Transact-SQL
33 lines
884 B
Transact-SQL
|
|
-- This block of comments will not be included in
|
|
-- the definition of the procedure.
|
|
-- ================================================
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
-- =============================================
|
|
-- Author: SafetyRally
|
|
-- Create date:
|
|
-- Description:
|
|
-- =============================================
|
|
drop procedure ProcSyncParticipacao
|
|
go
|
|
create PROCEDURE ProcSyncParticipacao
|
|
-- Add the parameters for the stored procedure here
|
|
@provaID varchar(10),
|
|
@cnnStr nvarchar(200)
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
|
|
delete from participacaoProva
|
|
|
|
declare @str varchar(max);
|
|
select @str = 'select P.*, S.unitid from participacaoprova P, safetybox S where P.SafetyBoxId = S.dispositivoid and provaid=' + @provaID ;
|
|
|
|
exec ('INSERT into participacaoprova Select * from OPENROWSET(''SQLNCLI'',''' + @cnnStr + ''',''' + @str + ''') AS a;')
|
|
|
|
END
|
|
GO
|