Get all tables from database – SQL Server –Get all tables from database – SQL Server SELECT schema_name(t.schema_id) as schema_name,
Category: SQL SERVER
012. Get all schemas in SQL Server database
Get all schemas in SQL Server database –Get all schemas in SQL Server database SELECT s.name as schema_name, s.schema_id, u.name
011. Get all available Databases in SQL Server Instance
Get all available Databases in SQL Server Instance select [name] as database_nane, database_id, create_date from sys.databases order by name
006. Find most used column names in database – Sql Server
Find most used column names in database Query: select col.name as ColumnName, count(*) as Tables, cast(100.0 * count(*) / (select
Difference between temporary table and table variable in sql server
Difference between temporary table and table variable in sql server Table variable Temporary table You can use it in User
010. Generate CREATE Index script for all indexes in database in Sql Server
Problem: Sometime DBA’s want to get script of indexes from their current database. How anyone can get “Drop and Create
003. Find Most Expensive Stored Procedure Sql Server
Problem: An important step in optimizing a system is to take a holistic approach and look at stored procedures that
135. Remove Cross duplicate rows in SQL SERVER
Remove Cross duplicate rows in SQL Server Hello friends, I got one question from my friend who recently appeared for
080. Analyse Missing Index Sql Server
Analyse Missing Index Sql Server- Script 1 /* [Date of Creation]: 08/20/2017 [Contact]: technothirsty@gmail.com */ SELECT TOP 100 PERCENT DB_NAME()
004. Find most expensive queries-Sql Server
———********* Most expensive queries starts****** ———— SELECT TOP 10 SUBSTRING(qt.TEXT, (qs.statement_start_offset/2)+1, ((CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(qt.TEXT) ELSE qs.statement_end_offset
009. Find unused Indexes – Sql Server
—– ************ Unused Index Script Starts********———- SELECT TOP 25 o.name AS ObjectName , i.name AS IndexName , i.index_id AS IndexID
008. Find redundant indexes Sql Server
————****** Script to find redundant indexes *********——- ;WITH MyDuplicate AS (SELECT Sch.[name] AS SchemaName, Obj.[name] AS TableName, Idx.[name] AS