Click here to Skip to main content
15,891,607 members
Everything / Programming Languages / SQL

SQL

SQL

Great Reads

by Alex Pumpet
A simple program for comparing table data from two sources - SQL databases, Excel, CSV or XML-files
by Thomas Weller
Demonstrates how to run Python scripts from C#
by Mubin M. Shaikh
Create time dimension with 24 hour plus values and time buckets in your data warehouse
by Christoph Buenger
Describes PHP application development with the free Scavix Web Development Framework (Scavix-WDF).

Latest Articles

by Mishael Ogo
A look at a simple SQL builder for Dapper
by GabrieleTronchin
In this project, I've implemented the Transactional Outbox Pattern using EF Core.
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

All Articles

Sort by Title

SQL 

5 Nov 2011 by Ravi Tuvar
Identity Value
7 Sep 2012 by zippy1981
This is an alternative for "ODBCTracer"
16 Jul 2015 by Math08avan
A simple example for CRUD actions using WCF service in ASP.NET
8 Jul 2015 by Rodrick Kazembe
This is a step by step SQL Server Stored Procedures tutorial for beginners with insert, update, delete and select examples.
7 Jun 2010 by Lee Humphries
LINQ translates .count() to a SQL query that uses COUNT(*), but on large tables even count(*) can be too slow. Here's another way
8 Jun 2010 by basementman
Or, assuming your table has an index, you could do this "old-school" as:select MAX(rows) from sysindexes where id = Object_ID('{tablename}')
12 Jan 2016 by shijo joseph
An ADO.NET Layer for SQL Server and Oracle which makes it easier for interfacing with database
28 Jul 2023 by AmrDeveloper
Introduce GQL (A Git Query Language) to perform SQL like queries on .git files
15 Oct 2020 by RickZeeland
PostgreSQL notifications Windows Forms application
8 Oct 2012 by Harry Hai Huang
A simple math formula to get special dates.
10 Nov 2013 by Rajat-Indiandotnet
A unique feature of SQL SERVER Loop with Go statement
24 Oct 2012 by Ramanujam Shankar
Show data in grid view control of Windows Stores App using web service or WCF
9 Dec 2009 by Mark Graham
When searching between datetimes in SQL(or SQL in a Stored Proc) we can't just do:select * from where CreateTime >= @DateFrom and CreateTime
11 Feb 2012 by Jobless Creature
HH:MM Time format addition
7 Jun 2011 by Shahriar Iqbal Chowdhury/Galib
Hi,Here is an alternative for your solutionSELECT CAST(DATEADD(MILLISECOND,SUM(DATEDIFF(MILLISECOND,0,CAST(TMP.TotalTime as DATETIME))),0) as TIME)FROM( SELECT CAST(timeduration AS TIME) TotalTime FROM mytable) TMP
10 Feb 2012 by abdul sami
select aday, code, convert(varchar(5), min(atime), (108))MinTime, convert(varchar(5), max(atime),(108)) MaxTime from testgroup by aday,codeorder by aday asc
10 May 2015 by Ankit Bansal MVP
This articles explains the insertion of data into SQL Database using Stored Procedures with Output Parameters. Some Bootstrapping is also used to create a good looking HTML.
19 Feb 2015 by DrABELL
Technique to extend capability of standard SQL by adding the Aggregate Product Function
31 Aug 2015 by Peter Leow
This is a simple web application to illustrate visually the difference between Ajax and non-Ajax calls that take place all in a single web page.
10 Aug 2011 by Wendelius
Or simply:exec msdb..sp_help_jobsp_help_job (Transact-SQL)[^]
1 Apr 2010 by otomazeli
Introduction...
13 Oct 2011 by Elina Blank
When cursors are inside transaction, it is sometimes easy to forget to close the cursor
13 Oct 2011 by Elina Blank
An alternative (simpler way :) ) is:BEGIN TRANDECLARE IdCursor CURSOR FOR SELECT Id FROM MyTable OPEN IdCursor FETCH NEXT FROM IdCursor INTO @CurrentIdWHILE (@@FETCH_STATUS) = 0 BEGIN -- do work IF @@error 0...
18 Oct 2011 by Kabwla.Phone
You also might want to look into the "LOCAL" keyword.This limits the scope of the cursor to the context in which it is created.DECLARE IdCursor CURSOR LOCAL FOR SELECT Id FROM MyTableThis is beneficial for many reasons.
18 Oct 2011 by Elina Blank
To see the default value of the cursor scope:select * from sys.databases(if value of "is_local_cursor_default" is 0 then scope id global, otherwise it is local).The scope is GLOBAL by default (for compatibility reasons).To change default scope use following:ALTER DATABASE...
18 Dec 2016 by NightWizzard
Convert amounts to their spoken equivalents
28 Sep 2015 by Member 11313437
How to easily anonymize (or pseudonymize, depending on the depth of performing) patients' proper data in clear text in MySQL
14 Nov 2012 by Sadeque Sharif
Another way to solve the issue of “A network-related or instance-specific error occurred while establishing a connection to SQL Server…”
26 Aug 2015 by nithyananthams
Different options to get Identity from SQL Server and how OUTPUT clause helped me to get the accurate Identity value compare with other options.
15 Oct 2015 by Shyam S Singh
This is a simple tip to describe how to write an optimized SQL query when we are dealing/working on large amount of data.
16 Nov 2015 by sandeepmittal11
Apply Operator in SQL Server
14 Mar 2015 by Gaurav_Chaudhary
This tip is a brief introduction to Apply operator in SQL server
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
8 May 2012 by Chamila Nishantha
This tip describes how to add a running total column to a result set
14 May 2012 by Wendelius
This is an alternative for "Applying Running Total to a Result set"
1 Jul 2014 by Ryszard Dżegan
How to get around restrictions for parameters in OLE DB connection type while working with SSIS and BIDS.
2 Sep 2015 by Peter Leow
Get your database to generate unique running IDs for your application
3 Jan 2016 by JoaoSousa23
Using MVC, Entity Framework, ASP.NET5 Scaffolding, and Azure SQLServer you can create a web application that stores your information on an SQL Azure database. This demo shows you how to create a web application with MVC and Entity Framework 7, that communicate with a SQL Azure Database
4 Mar 2014 by Haydn Chapman
A method to update a table column with a random set of specified values
7 Dec 2015 by Divyant Kulshrestha
This tip is useful when we have to move data from Oracle database to SQL Server database or vice-versa using SSIS.
8 Aug 2015 by Harsh Aggarwal - India
It's about making back up of database in SQL server 2008 and above you can get rid of making bak file manually.
15 May 2021 by be05x5
SQL script that will generate XML code that you can copy paste into your RDL file and just do it that way
4 Jul 2022 by DiponRoy
How to auto increment column options in databases
25 Jun 2018 by connect ashish yadav
Auto increment column value is not part of transaction
30 Mar 2024 by GabrieleTronchin
Automatic creation of non clustered indexes using system SQL entities
19 Apr 2012 by Deepak_Sharma_
This article will show how to create an auto-suggest TextBox that will suggest data from a SQL Server database column.
31 Mar 2017 by ergohack
Do you need to update everyone's TFS picture? Or set the notification email address for that calcitrant employee?
13 Sep 2012 by CorvetteGuru
Backup Stored Procedures in SQL Server.
25 Jul 2012 by Dan Steuer
This article will help manage automatic database purges according to basic Document Management principles.
1 Oct 2014 by NaibedyaKar
How to check the query locking the table and to unlock it
18 Feb 2012 by Mahmud Hasan
Be Very Careful When You Write SQL Trigger
8 Mar 2014 by SanSkun
How to bind holiday list and information about those holidays from database
28 Mar 2012 by PIEBALDconsult
Performing a bitwise OR aggregate in SQL Server
31 Jan 2017 by #realJSOP
Using common table expressions to build data from thin air.
23 Nov 2012 by Rob Branaghan
Just a function to make populating a datetime variable easier!
26 Nov 2012 by André Kraak
This is an alternative for "Build a Date Function"
5 Jun 2022 by Ramesh Bevara
An overview of a helper class to build dynamic order by clause in LINQ query in C#
24 Oct 2016 by Aless Alessio
Use the OLE Automation Procedures to retrieve data from a Web Service and parse the JSON response into a table format
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.
17 Jan 2013 by Wendelius
This tip describes how to calculate an aggregate for dynamically defined columns using UNPIVOT clause.
8 May 2017 by Nirav Prabtani
How to calculate distance between two geolocations or find out distance within a specific radius by SQL Server
17 Dec 2014 by Mohammed A. Mohiuddin
Calculating Average Processing Time in hours excluding weekends
21 Dec 2012 by Nathan Stiles
Calling CL programs on the IBM i on Power from PHP using DB2 stored procedures.
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.
1 Mar 2020 by Sanwar ranwa
How to create a cascading dropdown using ReactJS and Web API
8 Mar 2010 by Neh.C
select * from table where and column COLLATE SQL_Latin1_General_CP1_CS_AS = 'G%E3%97O%D7'
12 Jan 2016 by AgarwalPriyanka, ErGauravSharma
Challenges faced in data migration testing
23 Feb 2024 by Mohammad Elsheimy
One of the major issues encountered when connecting to databases after porting ASP.NET app to Docker Linux containers.
15 Aug 2015 by IssaharNoam
Simple and customizable Chat Conversation control, with DataTable datasource, inspired by SMS application balloons in OnePlus One Android smartphone.
6 May 2013 by Hernán Hegykozi
This tip explains how to calculate the Check Digit Vertical (CDV) and Horizontal (CDH) by SQL Server.
19 Jan 2013 by Wendelius
This tip shows how to get rows from a table where a field contains a number that is a power of 2 using LOG function.
23 Apr 2014 by mohamedkamaleed
27 Nov 2012 by Paulo Buchsbaum
A simple way to generate checksum for tables and databases.
26 Jul 2011 by #realJSOP
One way to effectively zero the columns any DataRow object.
10 Mar 2015 by Jignesh G Trivedi
This tip will help you to understand CLR procedure.
3 Jan 2013 by Levente Kupás
CLR-addon for T-SQL DATE transformation and Split-String
1 Aug 2014 by Uppuluri Aditya
COALESCE VS ISNULL in SQL Server - Part1
15 Nov 2015 by sandeepmittal11
COALESCE in SQL Server
8 Jan 2020 by Homero Ibarra Ramírez
Tool on T-SQL to code basic generator for SQL Server
14 Jul 2010 by Mycroft Holmes
Why do developers insist on separate procedures to do these jobs
4 Apr 2011 by A.J.Wegierski
For Oracle: -------------------------------------------------------------------------------- -- DESCRIPTION -- Universal save -- PARAMETERS IN -- vTRYB: mode: (I)nsert/(D)elete/(U)pdate -- rc: record -- PROCEDURE zapiszObiekt(vTRYB IN...
8 Apr 2011 by thatraja
DescriptionC...
3 Jan 2012 by Dnyanesh Wahiley
CREATE PROCEDURE sp_Insert ( @ID int, @Name char(20), @Mode char(20) ) ASif @Mode='Insert in Employee'Begin insert into Employee(Employee_ID,Employee_Name)values(@ID,@Name)Endelse if @Mode='Insert in Student'Begin insert into...
27 Sep 2014 by Ahmad A.A. Ahmad
Combining MDX with T-SQL in One Result Set for SSRS (Hybrid Query)
12 Nov 2013 by Jobless Creature
CTE To find all the related nodes in a hierarcy
5 Apr 2021 by Rijwan Ansari
How to compare two databases using SQL Server Database Project (Template) available in VS.
22 Jan 2015 by Abu Zafor Khairuzzaman
Comparison Chart for Two Different Time Frames in SSRS
26 Sep 2017 by Haroon Ashraf
A quick way to calculate first and last day of curent month and previous month
6 Dec 2012 by Ravi Tuvar
Concatenate rows with comma separated string in SQL.
8 Mar 2012 by Ramanujam Shankar
Using COALESCE function - concatenate many rows into a single text string output in SQL Server.
25 Feb 2012 by e-Lopes
How to concatenate many rows into a single text string using SQL Server 2008.
25 Feb 2012 by Sanjay K. Gupta
How to concatenate many rows into a single text string using SQL Server 2008
27 Jul 2015 by Daniel Miller
This tip describes the code to create a custom SQL Server aggregate function that concatenates multiple string values into a single delimited value.
13 Nov 2012 by SergioAmorim
SQL Server and Oracle terms may match, but they can have a very different meaning. This article will help you match one system to the other.
14 Oct 2012 by Rakesh NITian
Connecting SQL Server 2012 Express from SharePoint 2013 Configuration Wizard