DECLARE
	@RECORD_ID	INTEGER,
	@DATE		DAtetime,
	@GUID			INTEGER,
	@CAPTION		VARCHAR(500)		
								
DECLARE c_REDO CURSOR FOR 
	select GUID,NODE_CAPTION from VWPMO_STRUCTURE_NODES where ENTITY_ID = 8 and CREATE_RECORD = 1
  OPEN c_REDO 
    FETCH NEXT FROM c_REDO INTO @GUID,@CAPTION
    WHILE @@FETCH_STATUS = 0
	BEGIN

		FETCH NEXT FROM c_REDO INTO @GUID,@CAPTION
	END
CLOSE c_REDO
DEALLOCATE c_REDO

/*########################################
---CHECKIDENT
##########################################*/
DBCC CHECKIDENT ('TBPMO_CONTROL_SCREEN', RESEED, 1);  

select * 
from sys.objects 
where (type = 'TR' or type = 'P') 
  and modify_date > dateadd(m, -1, getdate()) order by modify_date desc
/*########################################
---MASSEN INSERT
##########################################*/
Declare @Id int
Set @Id = 1

While @Id <= 200000
Begin 
   Insert Into TBGI_TEST_KREDITOR (KREDITOR_NAME,CITY) values ('Kreditor- ' + CAST(@Id as nvarchar(10)),
              'City - ' + CAST(@Id as nvarchar(10)))
   --Print @Id
   Set @Id = @Id + 1
End
/*########################################
---Text EXISTS IN PROCEDURE
##########################################*/

SELECT type, *
FROM sys.objects
WHERE OBJECT_DEFINITION(object_id) LIKE '%FROM TBIDB_TERM_LANGUAGE%'
--AND type IN ('V')
ORDER BY name
