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