This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW dbo.vwdependencies | |
AS | |
SELECT DISTINCT c_p.oid AS tbloid | |
,n_p.nspname AS schemaname | |
,c_p.relname AS NAME | |
,n_c.nspname AS refbyschemaname | |
,c_c.relname AS refbyname | |
,c_c.oid AS viewoid | |
FROM pg_class c_p | |
JOIN pg_depend d_p ON c_p.relfilenode = d_p.refobjid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Can be used to move a large amount of data from one table to another in chunks to keep transaction log and temp db under control */ | |
CREATE PROCEDURE [SchemaName].[moveData] | |
AS | |
BEGIN | |
DECLARE | |
@row INT = 0 | |
,@step INT = 100000 | |
,@max INT | |
SELECT @max = max(dv_keyid) |
NewerOlder