Results for "SQL Server"
68 / 184 posts
SQL Server Configuration Manager
Introduction Jab hum Microsoft SQL Server install karte hain , tab kuch important tools automatically install ho jate hain. Unme se ek bahut important tool…
SQL Server System Databases
Introduction SQL Server me jab hum kaam karte hain, to generally hum tables, queries aur user databases par focus karte hain. Lekin ek hidden backbone hota…
TempDB in SQL Server
Introduction SQL Server me ek aisa database hai jo har query, har process aur almost har operation me involve hota hai. Ye ek temporary w…
How to comma separate value by using XML in SQL server
Before SQL Server 2017 (14.x), you can achieve the comma-separated values using the XML method. Here's an example of how you can achieve this: DECLARE @Sta…
Added columns in a table by dynamic ways
IF OBJECT_ID('AddedDynamicColumn','P') IS NOT NULL BEGIN DROP PROC AddedDynamicColumn END GO CREATE PROCEDURE AddedDynamicColumn AS BEGIN SELECT ED.empid,E…
How to get first date of given date or month.
Get First date of month: SELECT DATEFROMPARTS(YEAR(GETDATE()), MONTH(GETDATE()), 1) AS FirstDayOfCurrentMonth Create function for that IF NOT EXISTS (SELEC…
How to one series with comma separate(any Delimiter) value split into in rows
If we have one series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitSerie…
How to Two series with comma separate(any Delimiter) value split into in rows respectively
If we have two series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitTwoSe…
Use of Apply(Cross and Outer) operator in SQL server
APPLY operator joins two table expressions. Also, I'll show how it differs from regular JOINs. Operator: CROSS APPLY Similar: INNER JOIN When to Use: Use a…
Find column in the whole database in sql server
To find a specific column in the whole database in SQL Server, you can query the information schema views. Here's a query you can use: SELECT table_name, c…
How to use GOTO statement in SQL server
If you want to jump to a specific point in your SQL code, you can use the GOTO statement. The GOTO statement is used to exit a loop or a nested block of co…
How to use Magic (virtual) table INSERTED and DELETED in SQL server
Magic Tables are virtual tables that are automatically created and maintained by SQL Server for each data modification operation performed on a table. They…
How to find table column information by using SQL query
Comprehensive Guide to Fetching Table and Column Metadata with SQL Server Stored Procedures When working with databases, understanding the structure of tab…
UNION, UNION All, INTERSECT, EXCEPT used in SQL Server
UNION : The UNION operator is used to combine the result sets of two or more SELECT statements into a single result set. It removes duplicate rows from the…
What is an Index? Explain its different types in SQL
✅ Index in SQL Server (इंडेक्स इन SQL सर्वर): Index SQL Server में एक database object (डेटाबेस ऑब्जेक्ट) है जो टेबल के डेटा को जल्दी से प्राप्त करने के लिए…
What is View in SQL server
A view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table. IF OBJECT_ID('ViewTable','…
Master Database in SQL Server
Introduction SQL Server me agar koi ek database sabse zyada critical hai, to wo hai: Master Database Ye SQL Server ka core brain hai. Agar master database …
Triggers in SQL server
A trigger in SQL is a special type of stored procedure that runs automatically when certain actions happen in a table or view . A trigger cannot be explici…
SQL Server Data type
SQL Server provides a variety of data types to store different kinds of data efficiently. Here are some commonly used SQL Server data types: CHAR(size): A …
Window Aggregate Functions in SQL
What is window function: Imagine you have a dataset with many rows, and you want to perform some calculations on each row based on a group of rows related …
Implementing Transactions,Error Handling, and Dynamic SQL in SQL
Think of a transaction as a complete package deal. It's like when you buy something from a store. You give them money, and in return, you expect to get the…
WAITFOR in sql server
The WAITFOR statement in SQL Server is used to introduce a delay or wait period in the execution of a batch, transaction, or query. WAITFOR DELAY '00:00:05…
What are Constraints in SQL?
SQL में constraints डेटाबेस टेबल में डेटा को सुरक्षित और सही बनाए रखने के लिए उपयोग किए जाते हैं। ये टेबल में डेटा की वैधता (validity) और अखंडता (integrity…
ANY and ALL operators used in SQL
The ANY operator: returns a boolean value as a result returns TRUE if any of the sub-query values meet the condition Any means that the condition will be t…
Order by index number in SQL
SELECT empid, lastname FROM HR.Employees ORDER BY 1 DESC --order by first column SELECT empid, lastname FROM HR.Employees ORDER BY 2 DESC --order by second…
Filtering the data with TOP and OFFSET-FETCH In SQL
TOP: SELECT TOP (5) productid, unitprice FROM Production.Products WHERE categoryid = 1 ORDER BY unitprice DESC; SELECT TOP (5) WITH TIES productid, unitpri…
XML Data – Complete Conceptual Guide (SQL Server Perspective)
How insert data on table from XML in SQL server, example: There are two method for insert data in table from XML. DECLARE @XMLInput VARCHAR(MAX); SET @XMLI…
Insert <br> tag in SQL text string
CREATE or ALTER FUNCTION dbo.Fn_InserBRtag(@inputString NVARCHAR(MAX)) RETURNS NVARCHAR(MAX) AS BEGIN DECLARE @resultString NVARCHAR(MAX) = ''; DECLARE @st…
All Date Components in SQL
We get First Date , Last date ,month number, month Name,Year, Financial Year(Finyear), and Month Year from Date (Date Range of each single date). SET DATEF…
What is Power BI
Power BI is a suite of business analytics tools developed by Microsoft that allows you to visualize and share insights from your data. Power BI consists of…
What is RLS (Row-Level Security) in Power BI
RLS stands for Row-Level Security, which is a feature in Power BI (and also in SQL Server Analysis Services) that allows you to restrict data access at the…
SYS and INFORMATION_SCHEMA
sys In Microsoft SQL Server, the sys schema is a special schema that contains system views and stored procedures that provide metadata about the SQL Server…
Spark SQL useful command
Spark SQL provides a variety of commands for managing databases, tables, and performing SQL operations. CREATE DATABASE IF NOT EXISTS demo; SHOW DATABASES;…
Schema and Handling Corrupt data in PySpark
A schema in PySpark (and generally in data processing) defines the structure of a DataFrame, including the names and data types of each column. It serves a…
Pivoting and Unpivoting Data in SQL
Pivoting Data : Pivoting is the process of converting rows of data into columns, effectively changing the orientation of your data. It's useful when you ha…
What is Functions and Difference between Functions and Stored Procedures in SQL Server
What is a Function in sql : A function is a set of SQL Statements that perform a specific task. Basically, it is a set of SQL statements that accept only i…
What are System Tables, File Tables, External Tables and Graph Tables in SQL Server
1. System Tables Definition : System tables are internal tables used by SQL Server to store information about the database and server itself. These are met…
What is the Replication in MS SQL server
Replication is a way to copy data from one database to another and keep them in sync. This is useful when you want the same data available in multiple plac…
Database Backup in SQL Server
In SQL Server, taking a database backup is crucial for data recovery and protection. Here’s a basic guide on how to perform a database backup and restore i…
What is Blocking in SQL, How to solve blocking, and Kill Session
What is Blocking in SQL? Blocking occurs in SQL Server when one query or transaction holds a lock on a resource (like a row or table) and prevents other qu…
Log Shipping (Ship Log) in SQL Server
Log Shipping in SQL Server is a high-availability feature that allows you to automatically send transaction log backups from a primary database on one serv…
Data archive in SQL Server
A data archive refers to the process of moving inactive or less frequently used data from an operational system to a storage system , typically in a separa…
Database Permissions in SQL Server
In SQL Server, database permissions control what actions users can perform on specific database objects (like tables, views, and stored procedures). Permis…
Index Rebuilding vs. Reorganization in SQL Server
As a database grows, maintaining optimal performance becomes crucial. One of the key contributors to performance degradation over time is index fragmentati…
Understanding Cursors in +SQL Server: A Complete Guide
When working with databases, most SQL operations are designed to handle large sets of data at once. However, there are cases where you may need to process …
Data Import from text/CSV file in SQL Server
Step-by-Step Explanation 1. Checking and Dropping Existing Temporary Tables Before creating the temporary tables, the script ensures that any previously ex…
Understanding Locking Hints in SQL Server: NOLOCK, ROWLOCK, and UPDLOCK
What Are Locking Hints? Locking hints are special options you can include in your SQL queries to tell SQL Server how to handle locks on the data being quer…
SQL Server Optimization Q&A
1. What is SQL Server Optimization? Answer: SQL Server Optimization ka matlab hota hai database ka performance better banana — jaise queries fast chalna, k…
What are Data warehouse, Data Lake ,data mining and DataMart and MetaData
Why a Data Warehouse? (Data Warehouse ki zarurat kyu hoti hai?) Aaj ke time me companies ka data multiple sources me store hota hai, jaise: • SQL Server da…
Understanding Default Size of VARCHAR in SQL Server
Introduction When working with SQL Server, developers often use the VARCHAR data type to store variable-length character data. However, many overlook a cri…
The ALTER TABLE statement in Microsoft SQL Server (MSSQL) and PostgreSQL
The ALTER TABLE statement in Microsoft SQL Server (MSSQL) and PostgreSQL is used to modify the structure of an existing table. It allows you to: Add, drop,…
Comparison of WHERE Clause Operators in MSSQL vs PostgreSQL
Here's a comparison of how operators in the WHERE clause are used in Microsoft SQL Server (MSSQL) vs PostgreSQL : Operator Purpose Used in MSSQL Used in Po…
Table Types Comparison: SQL Server vs PostgreSQL
Table Type SQL Server PostgreSQL Scope / Lifetime Usage Notes Permanent Table CREATE TABLE Employee (...) CREATE TABLE Employee (...) Permanent in DB until…
Working with Multiple Grouping Sets in SQL Server
🔍 1. Background - क्यों ज़रूरत पड़ी GROUPING SETS की? जब हमें एक ही query में अलग-अलग तरीके से data को group करके summary चाहिए होती है, तब हम GROUPING SE…
MDF, NDF, LDF, and Filegroups
🔹 1. Filegroup kya hota hai? 🔸 Definition: Filegroup SQL Server में logical storage unit hota hai, jisme ek ya zyada data files hoti hain. Ye filegroups …
Table Partitioning in SQL Server
Table Partitioning एक advanced database concept है जिसका उपयोग बड़े tables को छोटे, manageable हिस्सों (partitions) में बाँटने के लिए किया जाता है। इससे pe…
Database Shrink in SQL Server
Database shrink ka matlab hai database file (ya log file) ke size ko chhota karna by removing unused space . Matlab, agar tumhare DB me data delete ho gaya…
SQL Server Deadlock & Performance Monitoring Made Easy
Learn how to detect SQL Server deadlocks and monitor performance with ready-to-use stored procedures for faster troubleshooting and optimization.
Statistics in SQL Server
Statistics SQL Server ke “mind” jaise hote hain. Ye SQL Server ko batate hain ki table me data kis tarah se distribute hai — jaise kitne values unique hain…
What is “CREATE TABLE TYPE” in SQL Server?
Ye ek User-Defined Table Type (UDTT) hota hai. Aap SQL Server me ek custom table ka design bana lete ho, jise aap baad me Stored Procedures, Functions, aur…
JSON Data – Complete Conceptual Guide (SQL Server Perspective)
🔹 JSON kya hota hai? (Quick recap) JSON (JavaScript Object Notation) ek lightweight text format hota hai data exchange ke liye. Example: { "empId…
Dynamic CREATE TABLE Script in SQL Server
DECLARE @TableName NVARCHAR(100) = 'Employee'; DECLARE @SQL NVARCHAR(MAX) = ''; DECLARE @PKCols NVARCHAR(MAX) = ''; -- Get Primary Key Column(s) SELECT @PK…
SQL SQL Server Agent: Automation Ka Powerhouse in SQL ServerServer Agent
Agar aap production environment me kaam kar rahe ho, to aapko pata hoga ki kuch tasks aise hote hain jo baar-baar karne padte hain — jaise daily backup len…
SQL Server Agent Jobs & Schedules – Complete Practical Guide (Step-by-Step)
Agar aap SQL Server me automation samajh chuke ho, to next logical step hai SQL Server Agent Jobs aur Schedules ko practically use karna . Is blog me hum d…
SQL Server Agent Alerts, Operators, Database Mail & Job Activity Monitor
Production environment me sirf jobs schedule karna hi kaafi nahi hota. Hume monitoring aur notification system bhi chahiye hota hai taaki agar koi job fail…
SQL Server Administration – Management Tools Overview
Is section me hum mainly SQL Server ke management tools aur system databases ko samjhenge. SQL Server Management Tools Jab aap Microsoft SQL Server install…
SQL Server Management Studio (SSMS) – Complete Beginner Guide
SQL Server Management Studio Kya Hai? SQL Server Management Studio (SSMS) ek graphical interface (GUI tool) hai jisse aap SQL Server ke almost saare operat…
SQL Server Multi-Level Approval Workflow with Auto Skip Logic
In many enterprise applications like HRMS, Travel Requests, Expense Approval, Purchase Approval , we need a multi-level approval workflow . But real system…