top of page

Search
SQL Server Find Missing Index using Query Store
--Query to find missing index from query store, from last 30days usage SELECT TOP 20 qsq.query_id, SUM(qrs.count_executions) *...
Kunal Ranpura
21 minutes ago1 min read
0 views
0 comments
SQL Server Profiler Trace
--Import multiple trace file in sql Table. --All the rollover files will be automatically imported --provide number tracefile to capture...
Kunal Ranpura
Feb 19, 20241 min read
1 view
0 comments
SQL Replication Mark Transaction as commit
--SQL Server Database log full due to replication, you can run the following command to mark all ---the replication transaction is done,...
Kunal Ranpura
Feb 5, 20241 min read
6 views
0 comments
Disable Change Data Capture for multiple tables
--disable cdc master --Table Contains list of all the tables where cdc needs to be disabled - [dba].dbo.replication_cdc_table --execute...
Kunal Ranpura
Dec 21, 20231 min read
4 views
0 comments
Find All Primary Key in SQL Server
select schema_name(tab.schema_id) as [schema_name], pk.[name] as pk_name, substring(column_names, 1, len(column_names)-1) as [columns],...
Kunal Ranpura
Apr 14, 20231 min read
6 views
0 comments
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...
Kunal Ranpura
Mar 8, 20231 min read
10 views
0 comments
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...
Kunal Ranpura
Mar 8, 20231 min read
7 views
0 comments
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,...
Kunal Ranpura
Mar 8, 20231 min read
2 views
0 comments
Script to Clone Table in Snowflake
--clone table in snowflake create table orders_clone clone orders;
Kunal Ranpura
Mar 8, 20231 min read
4 views
0 comments
Find Snowflake task run history
--get task history: select * from table(information_schema.task_history( scheduled_time_range_start=>dateadd('hour',-1,current_timestamp(...
Kunal Ranpura
Mar 8, 20231 min read
1 view
0 comments
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...
Kunal Ranpura
Mar 8, 20231 min read
2 views
0 comments

Automatic Query Tunning in SQL Server
The Query Store provides database administrators with in-depth insights on query plans and performance metrics. By default, execution...
Kunal Ranpura
Jul 1, 20222 min read
36 views
0 comments


Skip Target - Temp DB Proportional fill algorithm
Understanding the SQL Server Proportional fill algorithm When creating a database, SQL Server maps this database with minimum two...
Kunal Ranpura
Jun 24, 20222 min read
12 views
0 comments

Cannot connect to RDS Database instance
connecting to RDS instance SQL Server
Kunal Ranpura
Jun 1, 20221 min read
8 views
0 comments
Snowflake Administration
Script to clone tables in snowflake Run this script in sql server to generated the output command: snowflake table clone script. SET...
Kunal Ranpura
Apr 7, 20221 min read
10 views
0 comments
SQL Server find Database User Permission
--Execute the following script against the User Database where you need to find DB User permission. DECLARE @sql VARCHAR(2048) ,@sort INT...
Kunal Ranpura
Jan 28, 20203 min read
67 views
0 comments
SQL Server Snapshot Isolation
--Script to verify snapshot isolation enabled SELECT name , s.snapshot_isolation_state , snapshot_isolation_state_desc ,...
Kunal Ranpura
Jan 15, 20201 min read
14 views
0 comments
SQL Server Script to Setup Change data capture
Below is the script to enable change data capture to customer table. USE DB_name GO -- Enable CDC on the database. if ( not exists (...
Kunal Ranpura
Jan 13, 20201 min read
34 views
0 comments
SQL Server List all Partitioned tables
Find list of all the partitioned tables in sql server. use userdb_name go select distinct t.name from sys.partitions p inner join...
Kunal Ranpura
Jan 13, 20201 min read
26 views
0 comments
SQL Server Script DB User Permissions
---Script to find user permission in DB DECLARE @sql VARCHAR(2048) ,@sort INT DECLARE tmp CURSOR FOR /***********************************...
Kunal Ranpura
Jan 13, 20203 min read
14 views
0 comments
bottom of page