Kunal RanpuraMar 8, 20231 minIdentify slow running queries in snowflakeselect distinct count(query_id) as total_query --,QUERY_TEXT --,DATABASE_NAME --,SCHEMA_NAME --,QUERY_TYPE --,USER_NAME --,ROLE_NAME...
Kunal RanpuraMar 8, 20231 minScript to find role assigned to the user in snowflakeselect GRANTEE_NAME AS "USERNAME", ROLE from SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_USERS where DELETED_ON is null and Role = 'ROLENAME' and...
Kunal RanpuraMar 8, 20231 minScript Find long running Queries in Snowflakeselect Total_Elapsed_Time/60000 Total_Time_MINS, Database_name, schema_name, User_name, Role_name, Warehouse_name, Warehouse_size,...
Kunal RanpuraMar 8, 20231 minScript to Clone Table in Snowflake--clone table in snowflake create table orders_clone clone orders;
Kunal RanpuraMar 8, 20231 minFind Snowflake task run history--get task history: select * from table(information_schema.task_history( scheduled_time_range_start=>dateadd('hour',-1,current_timestamp(...
Kunal RanpuraMar 8, 20231 minSnowflake Create Sequence - it uses two cursors one for schema name and another for table nameSET ANSI_NULLS ON; SET ARITHABORT ON; SET QUOTED_IDENTIFIER ON; SET NOCOUNT ON; Declare @SEQUENCE_SCHEMA varchar(max); Declare...
Kunal RanpuraApr 7, 20221 minSnowflake AdministrationScript to clone tables in snowflake Run this script in sql server to generated the output command: snowflake table clone script. SET...