DECLARE @ComputerName VARCHAR(50) 
DECLARE @PrinterSelect VARCHAR(70) 
DECLARE @NameReport NVARCHAR(70) 
DECLARE @CopyCount NUMERIC(18, 0) 
DECLARE @PrintPreview BIT 
Declare @DialogPrint BIT
DECLARE @ActivePrint BIT

DECLARE Cursor_Drug CURSOR FOR
SELECT ComputerName, CopyCount, PrintPreview, DialogPrint,ActivePrint, PrinterSelect, NameReport FROM dbo.KindFormPrint
WHERE FormName = N'ÝÑæÔ'
GROUP BY FormName, ComputerName,CopyCount, PrintPreview, DialogPrint,ActivePrint,PrinterSelect, NameReport
OPEN Cursor_Drug
FETCH NEXT FROM Cursor_Drug INTO @ComputerName, @CopyCount, @PrintPreview, @DialogPrint,@ActivePrint, @PrinterSelect, @NameReport
WHILE @@FETCH_STATUS = 0 
BEGIN
  IF NOT EXISTS(SELECT * FROM dbo.KindFormPrint WHERE FormName = N'ËÈÊ äÓÎå' AND ComputerName = @ComputerName)
	  INSERT INTO dbo.KindFormPrint
			  ( ComputerName ,
				FormName ,
				PrinterSelect ,
				NameReport ,
				CopyCount ,
				PrintPreview ,
				DialogPrint ,
				ActivePrint
			  )
	  VALUES  (@ComputerName, N'ËÈÊ äÓÎå', @PrinterSelect, @NameReport, @CopyCount, @PrintPreview, @DialogPrint, @ActivePrint)
  FETCH NEXT FROM Cursor_Drug INTO @ComputerName, @CopyCount, @PrintPreview, @DialogPrint,@ActivePrint, @PrinterSelect,@NameReport
END
CLOSE Cursor_Drug
DEALLOCATE Cursor_Drug



