Click here to Skip to main content
15,883,829 members
Everything / Database Development / SQL Server

SQL Server

SQL-Server

Great Reads

by Wonde Tadesse
This tip/trick helps to set a default value for blob data type such as Image, VarBinary.
by Jovan Popovic(MSFT)
Mapping properties in EF model to database columns that contain JSON
by Steve Krile
Fully AJAX-enabled user control used to select names from a database in a drop-down format.
by Mubin M. Shaikh
Create time dimension with 24 hour plus values and time buckets in your data warehouse

Latest Articles

by GabrieleTronchin
A simple stored procedure to add at your database to keep it reactive
by GabrieleTronchin
Automatic creation of non clustered indexes using system SQL entities
by yuvalsol
POCO generating application for SQL Server
by scastelli
SQL resolves special character challenges, streamlining NULL parameter handling

All Articles

Sort by Updated

SQL Server 

30 Mar 2024 by GabrieleTronchin
A simple stored procedure to add at your database to keep it reactive
30 Mar 2024 by GabrieleTronchin
Automatic creation of non clustered indexes using system SQL entities
24 Oct 2023 by Federico Di Marco
Query Excel or CSV files with T-SQL without importing them in a table first
1 Jul 2023 by DiponRoy
Split date time ranges into days or possibly other ranges using CTE in SQL Server
1 Jun 2023 by Micah Ebohon
Having MSQL and ODBC connection string in one configuration file for your application
24 Apr 2023 by Eligio Morgado H.
Compare two SQL Server databases and show difference in tables and fields
6 Feb 2023 by Venkat Chaitanya Kanumukula
Tableau is one of the powerful reporting tool which is on the market for over a decade. Here's a quick tour in designing BI reports with Tableau using Microsoft Dynamics AX 2012 R3/ Microsoft Dynamics 365 Finance and Operations.
8 Sep 2022 by Telegram:@ArastoAhmadi
Tutorial to monitor database changes without using tools and by using a simpler trick
5 Jul 2022 by DiponRoy
Using CASE with variable/SET, SELECT/UPDATE statement, WHERE clause, JOIN & ON clause
4 Jul 2022 by DiponRoy
How to auto increment column options in databases
28 Dec 2021 by DiponRoy
Delete all the records from the table using EF
2 Nov 2021 by Herman<T>.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN
20 Jul 2021 by Uladzislau Baryshchyk
In this article, I'll show you how easy it is to move your MS SQL database to Amazon RDS cloud
6 Apr 2021 by Satya Karki
How to import or restore BACPAC file using SSMS
19 Nov 2020 by cattman1970
Function that consumes a Columbia Gas account number of 11+ digits and returns the check digit
6 Nov 2020 by Igor Krupitsky
Fast function that excludes weekends and holidays
1 Jul 2020 by Trond Lind
Prevent brute-force login attacks on a remotely accessible SQL Server database using T-SQL
31 Jan 2020 by Christian Del Bianco
In this simple example, we are going to see how to update an HTML page when a SQL Server table change occurs, without the need to reload the page or make asynchronous calls from the client to the server.
8 Jan 2020 by Homero Ibarra Ramírez
Tool on T-SQL to code basic generator for SQL Server
8 Jan 2020 by E. Scott McFadden
This article explains how to create and use a self referencing key in a SQL Server Table.
28 Dec 2019 by Wendelius
How to overcome the error message "Types don't match between the anchor and the recursive part in column..." for varchar columns in a recursive CTE query
11 Dec 2019 by Akmishra0719
Daily reminder using SQL Agent and SignalR
30 Oct 2019 by Charles T. Blankenship
Backup and Restore SQL Server utility (where there is no SMSS onsite)
24 Oct 2019 by Nabil Droussi
This article will walk you with steps on how to install, configure and connect to SQL Server 15.x on,Linux Ubuntu Server 18.04 LTS
30 Sep 2019 by NightWizzard
Read and/or modify database objects like views, triggers, stored procedures and functions from .NET code.
21 Jul 2019 by DiponRoy
Select a default row for a query that returns no rows
10 Jul 2019 by DiponRoy
Finding week start and end date time from a given date time
9 Jun 2019 by Prasannakumaran Sarasijanayanan
Load data to temporary table, make any additional update if required, create necessary indices, finally DROP live table and RENAME temporary table to production table.
29 May 2019 by DiponRoy
A utility query to find table generations in SQL Server relational database
21 May 2019 by Herman<T>.Instance
When using SqlDependency, is it possible that a detected change leads to 0 rows in the SqlDependency results?
19 Feb 2019 by DiponRoy
How to do string split and join in SQL Server
14 Feb 2019 by DiponRoy
A utility class to send parameters for IN() operator in SQL using parameterized queries
17 Oct 2018 by User-12551084
Moving database file from one drive to another drive
1 Oct 2018 by Satnam Singh CapGemini
Improving backup performance
20 Sep 2018 by OriginalGriff
If you try to pass a DbNull.Value to an SQL Image column, you get an exception: "Operand type clash: nvarchar is incompatible with image" - not sure why it's throwing that, but it can be done.
10 Sep 2018 by Manjuke Fernando
How to give db_datareader access to a specific user across all the databases on a particular SQL Server
11 Jul 2018 by Satnam Singh CapGemini
Cannot Bulk Load Data Into the Table with Primary Key Constraint on it
6 Jun 2018 by Altaf Ansari
Dynamic creation of an SQL table by using an XML file, and importing data from an XML file to an SQL table.
8 Apr 2018 by Sameh Abdel Mongy
Deploy Reports rdl files to SSRS using C# script
25 Feb 2018 by GuyThiebaut
Solving the "Store update, insert, or delete statement affected an unexpected number of rows (0)" response.
2 Feb 2018 by Luca Astolfi
User defined procedure for make an HTML table from T-SQL Select statment
25 Nov 2017 by A.Ebrahimi
Connect to local database on MS SQL Server in local machine and develop node.js code
29 Oct 2017 by vinothharshad
Use the ON DELETE CASCADE option if you want rows deleted in the child table when corresponding rows are deleted in the parent table.
28 Oct 2017 by OriginalGriff
How do you call a Stored Procedure inside a query and use the SELECT results? Tricky...or is it?
22 Sep 2017 by #realJSOP
It doesn't always happen the way you expect.
26 Jul 2017 by OriginalGriff
Did you know that Windows provides a built in way to build SQL connection strings for you? Neither did I ... until I found UDL files.
17 Jul 2017 by Arif H Shigri
This tip will discuss the difference between ROW_NUMBER(), RANK() and DENSE_RANK().
8 May 2017 by Nirav Prabtani
How to calculate distance between two geolocations or find out distance within a specific radius by SQL Server
8 Feb 2017 by RedDk
Use ALT+SHIFT to "block" select text (thinking of justifying columnar relations of words/data/etc. so the visual appearance is perfectly tabular) ... and TAB (TAB+SHIFT to undo) to MOVE SELECTION right (and left) ...
31 Jan 2017 by #realJSOP
Using common table expressions to build data from thin air.
31 Jan 2017 by #realJSOP
A scalar function to determine if a given DateTime is one of the ten US federal holidays, using SQL Server.
29 Jan 2017 by Bart Ducal
Universal data change tracking solution for auditing SQL Server databases
27 Jan 2017 by Rajesh_K_Sharma
How to create CSV file in SQL
24 Jan 2017 by VINEET MISHRA 086
Convert column into rows without using pivot function in SQL
8 Jan 2017 by HHerzl
HowTo for generating a data dictionary from existing database
29 Dec 2016 by Paw Jershauge
An easy to use extendedproperty procedure (alternative to sp_dropextendedproperty, sp_addextendedproperty, sp_updateextendedproperty)
20 Dec 2016 by BharatRamV
Finds the Best Table for a given set of columns
18 Dec 2016 by NightWizzard
Convert amounts to their spoken equivalents
12 Dec 2016 by Suresh Dasari's
Auto Generate Code (CRUD) for 3 Layered architecture (Entity, Data Access & Business Layer) with Stored Procedures based on table design.
7 Dec 2016 by Wendelius
This tip demonstrates how to select valid records from a table that contains validity date limits.
31 Oct 2016 by Chris Maunder
Timing SQL calls with millisecond accuracy
28 Oct 2016 by Pavel Sinkevich
If data source is populated manually, there is a typical problem: a mix of visually similar Cyrillic and Latin letters. This tip describes how to fix it.
20 Oct 2016 by Bryan Kowalchuk
The two most common database lookup table patterns are examined
13 Oct 2016 by Wendelius
A little tip on how to format repeating values in SQL output using LAG function
6 Oct 2016 by Hussain Patel
Display the list of all Tables, the Referenced columns, the Referencing Table, the Referencing columns and the Constraint name in a database
4 Oct 2016 by Wendelius
Few tips for connecting to an SQL Server instance using DAC
1 Oct 2016 by Suvendu Shekhar Giri
Enhancement on dropping an object with check for existence in SQL Server 2016
30 Sep 2016 by Wendelius
TrimChar function which removes occurences of the desired character from both ends of a string.
15 Sep 2016 by GhostHost
Compare two databases to detect which object has been modified from an old version of the same database.
25 Aug 2016 by Gene R. Browning
Generate random dates (and times if you like) for your test data environment.
18 Aug 2016 by Michael Ecklin
Sometimes, we need to compare 2 tables to see what was changed. This tip shows you 2 different ways to compare data.
13 Aug 2016 by Krishna KV
Dynamic masking using SQL Server 2016
17 Jul 2016 by Sonali Agarwal
There are different types of Database Management System models used for organizing the logical data. Relational model is most popular and widely used model in DBMS.
11 Jul 2016 by Jatinath
This tip will help you to find a particular text used in SPs, Functions or tables
9 Jul 2016 by Prakash Lekhak
Dynamic SQL to get the list Table names
8 Jul 2016 by Michael Ecklin
This tip describes Microsoft SQL Server implementation of XIRR function.
1 Jul 2016 by bbsimonbb
World first implementation of the Dominic Strauss Kahn data access method!
10 Jun 2016 by Member 12574862
A new approach of calculating next N business days's date, provided we know the start date and the N number
1 Jun 2016 by Aqeeel
Identifying and deleting duplicate records from SQL Server Table
1 Jun 2016 by PIEBALDconsult
Interspersing 'Total' rows among summarized data rows in the correct order
16 May 2016 by Md._Mehedi_Hasan
This tip will help you to generate .xml file in AngularJs and ASP.NET MVC5 using XElement of C#.
3 May 2016 by Michael Haephrati
How to overcome an error message preventing you from saving a change in an SQL Server database
12 Apr 2016 by Shao Voon Wong
How to prevent SQL injection attacks when using dynamic SQL in stored procedures
9 Apr 2016 by NightWizzard
Handling for hex expressions and the trailing '}'
1 Apr 2016 by B. Clay Shannon
Save Excel (or other types of) files to SQL Server, then read them out again and make them downloadable via a link on an ASP.NET Web API page
23 Mar 2016 by Ahmet AYDIN
This post describes step by step how to run a Single Page Application template using ASP.NET Web API 2 and angularJS and how to use Web Application Project whose name is Dalyan.
9 Mar 2016 by Arslan Elahi
Get the Comma Separated Value of one or multiple columns from SQL table
8 Mar 2016 by markkang
This tip describes how to generate insert SQL statement from the records in an existing table in SQL server database
22 Feb 2016 by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
22 Feb 2016 by Indresh_Prajapati
This tip will help beginners to implement CRUD operations in ASP.NET MVC 5 using WebAPI 2 with scripting language as AngularJS and Database as MS SQL 2008R2.
1 Feb 2016 by Deepak A S
27 Jan 2016 by DataBytzAI
How to refresh intellisense after adding new objects in Microsoft SQL Management Studio
27 Jan 2016 by MarcusCole6833
Make some SQL XML dot style another way
21 Jan 2016 by smirson
This is an alternative for "String splitting/tokenizing using T-SQL user defined function."
20 Jan 2016 by Indresh_Prajapati
This tip will help beginners to implement CRUD operations in ASP.NET MVC 4 with scripting language as KnockOut and Database as MS SQL 2008R2.
16 Jan 2016 by Darek Danielewski
A small script to remove old user accounts
14 Jan 2016 by Bhishma Anil Kajaria
Browse and Copy data from your CSV file to SQL directly without any Windows application...
12 Jan 2016 by AgarwalPriyanka, ErGauravSharma
Challenges faced in data migration testing
12 Jan 2016 by shijo joseph
An ADO.NET Layer for SQL Server and Oracle which makes it easier for interfacing with database
2 Jan 2016 by RickZeeland
This console application converts an SQL Server database to PostgreSQL.