top of page
Search
Kunal Ranpura
Feb 19, 20241 min read
SQL Server Profiler Trace
--Import multiple trace file in sql Table. --All the rollover files will be automatically imported --provide number tracefile to capture...
1 view0 comments
Kunal Ranpura
Feb 5, 20241 min read
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,...
5 views0 comments
Kunal Ranpura
Dec 21, 20231 min read
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...
3 views0 comments
Kunal Ranpura
Apr 14, 20231 min read
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],...
6 views0 comments
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
Jul 1, 20222 min read
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...
32 views0 comments
Kunal Ranpura
Jun 24, 20222 min read
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...
8 views0 comments
Kunal Ranpura
Jun 1, 20221 min read
Cannot connect to RDS Database instance
connecting to RDS instance SQL Server
8 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
Kunal Ranpura
Jan 28, 20203 min read
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...
65 views0 comments
Kunal Ranpura
Jan 15, 20201 min read
SQL Server Snapshot Isolation
--Script to verify snapshot isolation enabled SELECT name , s.snapshot_isolation_state , snapshot_isolation_state_desc ,...
14 views0 comments
Kunal Ranpura
Jan 13, 20201 min read
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 (...
32 views0 comments
Kunal Ranpura
Jan 13, 20201 min read
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...
26 views0 comments
Kunal Ranpura
Jan 13, 20203 min read
SQL Server Script DB User Permissions
---Script to find user permission in DB DECLARE @sql VARCHAR(2048) ,@sort INT DECLARE tmp CURSOR FOR /***********************************...
14 views0 comments
Kunal Ranpura
Jan 12, 20201 min read
Deadlock Priority SQL Server
Specifies the relative importance that the current session continue processing if it is deadlocked with another session. --Deadlock...
24 views0 comments
bottom of page