

/*########################################
---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 '%PRPMO_CUST_CHECK_CONTROLS_HAAA%'
--AND type IN ('V')
ORDER BY name

DECLARE cursStrasse CURSOR FOR 
			select STRASSE from Strassen_Esslingen WHERE CONCAT(PLZ,' - ',ORTSTEIL) = @ORTSTEIL ORDER BY  STRASSE
		OPEN cursStrasse 
		FETCH NEXT FROM cursStrasse INTO @STRASSE
		WHILE @@FETCH_STATUS = 0
		BEGIN
			DECLARE @CHILDNODE_GUID BIGINT
			PRINT @STRASSE
			EXEC PRPMO_STRUCTURE_NODES_CHECK_NODE @CHILDNODE_GUID Output ,56,@STRASSE,@STRASSE,@NODE_GUID,'',0,@SEQUENCE,'MS','DEMO'
			SET @SEQUENCE += 1
		FETCH NEXT FROM cursStrasse INTO @STRASSE
	END
	CLOSE cursStrasse
	DEALLOCATE cursStrasse
