Click here to Skip to main content
15,891,597 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 Updated

SQL 

10 Aug 2011 by #realJSOP
Just say no to SELECT * in your SQL
26 Jul 2011 by #realJSOP
One way to effectively zero the columns any DataRow object.
17 Nov 2014 by #realJSOP
How to fix this ANNOYING problem
5 Oct 2015 by #realJSOP
Yes, you CAN document your stored procs in C# code.
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.
31 Jan 2017 by #realJSOP
Using common table expressions to build data from thin air.
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...
17 Sep 2012 by aasim abdullah
Get all indexes list in detail, with their involved columns
1 Oct 2012 by aasim abdullah
How do you know, if someone disabled your job at production database server. Who is the calprit. How to send a mail alert for this change ??
2 Oct 2012 by aasim abdullah
A simple query to get all databases size on a given instance.
17 Dec 2010 by Abdul Quader Mamun
You have deleted some records from different record position from your identity column table and you wan to reset it without delete records.
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
3 Dec 2014 by Abhishek Kumar Goswami
Sometimes, you might find different error handling ways inside a stored procedure like some people use the error code to check the behavior of code or some other techniques. In this tip, I am going to discuss one of the techniques and its special behavior in a situation and why.
20 Jan 2010 by Abhishek Sur
It is a common issue of many of the guys on how we can fetch a record based on its record number. It is really easy to get first 10 records usingSELECT TOP 10 * FROM EMPBut when we want to fetch records in such a way say I need to fetch record from 40 to 50. This comes very handy when...
22 Jan 2015 by Abu Zafor Khairuzzaman
Comparison Chart for Two Different Time Frames in SSRS
17 Dec 2013 by Adittya Gupta
Table Value Parameters in SQL Server 2008 with ASP.NET.
13 Sep 2014 by Afzaal Ahmad Zeeshan
A slight comparison of ASP.NET upon other (web) programming languages in the market and a discussion of me and some other (web) programming language developers.
12 Jan 2016 by AgarwalPriyanka, ErGauravSharma
Challenges faced in data migration testing
27 Sep 2014 by Ahmad A.A. Ahmad
Combining MDX with T-SQL in One Result Set for SSRS (Hybrid Query)
25 May 2010 by Ahmed Kahwaji
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.
31 Mar 2015 by Ajit Kumar Thakur Microsoft
This tip explains SQL Server metadata information. It will provide internal details of all available SQL Server 2012 Metadata.
1 Apr 2015 by Ajit Kumar Thakur Microsoft
This tip describes steps to learn DOS batch programming.
19 Feb 2010 by Alaric Dailey
This would work too :)As an explanation, I use datediff to get the number of days, divide that by the correct number of days in a year (keeping track of leap years, there are only 97 in every 400 years) and then FLOOR the result, thus making sure it doesn't get rounded up accidentally....
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
7 Oct 2014 by Alex_2979
How to get on track with Active Directory
18 Jun 2010 by Alexander Konstantinov
Two stored procedures helping developers do less things when they create tables and indeces
12 Nov 2014 by Alexandros Pappas
Lists the files that are installed with Windows 7 on a Virtual PC
20 Nov 2011 by AlexCode
A starting point for your transaction-aware SQL Server scripts
19 Sep 2013 by alifaraze
writing error in a text file is very easy but writing error from a custom assembly in reporting services requires permissions
10 Dec 2013 by Amey A khedekar
A scenario with data type of the resultant select columns with UNION.
20 May 2013 by Amey K Bhatkar
The use of With (NoLock) hit with a simple example.
20 Aug 2014 by Amol M Vaidya
A simple Data Connection Library to avoid rewriting code when the DB changes
28 Jul 2023 by AmrDeveloper
Introduce GQL (A Git Query Language) to perform SQL like queries on .git files
15 Feb 2011 by Amund Gjersøe
Visual Studio Query Builder does not work with PostgreSQL when you want to use filtering parameters. This tip show how to make your own "FillBy" methods.
3 Jul 2010 by Andrew Rissing
Using the pattern that Microsoft SQL Server Management Studio creates, it would be something along the lines of:IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[com_CountString]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))DROP FUNCTION...
26 Nov 2012 by André Kraak
This is an alternative for "Build a Date Function"
17 Jul 2012 by Ani_0707
This article intends to describe a simple and elegant way of converting local datetime to UTC and store it in DB.
19 Nov 2009 by Anish M
CREATE PROC GetChildNodes (@ID uniqueidentifier)ASBEGINWITH PermissionList (PermissionID, PermissionName, Level)AS(SELECT ap.PermissionID, ap.PermissionName, 0 AS LevelFROM Permission AS apWHERE PermissionID = @IDUNION ALLSELECT ap.PermissionID, ap.PermissionName, Level + 1FROM
15 Jul 2014 by anki.mathur
Restart hanged SQL Server scheduled job
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.
29 Aug 2013 by Ankit R Goud
This tip shows you how to insert image in database.
14 Apr 2014 by Ankur .K. Vishwakarma
This tip shows you a T/SQL function to split a string concatenated by a delimiter.
6 Oct 2013 by Anoop Kr Sharma
How to copy table and its data in SQL Server using Query as well as graphically
15 Aug 2016 by Anthony Lansbergen
Using sqlite3 for a multi language log where logdata can contain parameters.
5 Mar 2011 by Anton Burtsev
Performing fast concatenation of strings from different records
23 Nov 2011 by Antonino Porcino
How to use T-SQL function SCOPE_IDENTITY() to retrieve inserted rows identity values with CommandBuilders and DataAdapters
28 Sep 2015 by Antonio Soares
This tip shows three alternatives (an intuitive and less efficient, a more efficient one and a third more efficient one) to count all rows of all tables in a database.
23 Aug 2011 by Anurag Gandhi
I have gone through a lot of examples to sort alpha numeric data in sql. Here is my way:
16 Mar 2012 by Anurag Gandhi
A Query to copy an individual table data between databases
9 Jul 2013 by apachearun
How to do scheduling auto backup in SQL 2012
10 Jul 2013 by apachearun
How to create a new user and administer user creation in SQL 2012
10 Jul 2013 by apachearun
How to copy SQL table into Excel and other formats
14 Jul 2013 by apachearun
How to create new jobs in SQL 2012
9 Apr 2014 by Aqeeel
Implementing security in SQL Server by only allowing TCP/IP Network Protocol and changing default TCP port
1 Jun 2016 by Aqeeel
Identifying and deleting duplicate records from SQL Server Table
17 Jul 2017 by Arif H Shigri
This tip will discuss the difference between ROW_NUMBER(), RANK() and DENSE_RANK().
26 Oct 2014 by Arkadeep De
How to remove duplicate records using CTE in SQL
9 Sep 2014 by aroen kandaswamy
Custom database trace listener that supports logging of properties for enterprise library 5.0
26 Sep 2014 by Arora_Ankit
This tip will explain the difference between these three functions.
8 Oct 2014 by Arora_Ankit
This tip will provide you with an idea about basic things that you can use to get better performance from query.
9 Mar 2016 by Arslan Elahi
Get the Comma Separated Value of one or multiple columns from SQL table
27 Sep 2012 by Arunprasath Natarajan
Difference between Len() and Datalength().
21 May 2014 by Arvind Singh Baghel
Import CSV or txt File Into SQL Server Using Bulk Insert.
31 May 2015 by Asanka Perera
This process shows how you can integrate Google analytic data into your reporting server database in order to have daily reports and analysis to include data of your Google analytic account using a free available plugin for SQL Server Integration service called SSIS GoogleAnalyticsSource.
27 Jan 2013 by AshishChaudha
This tip talks about creating an auto complete textbox using jQuery.
26 Sep 2013 by Ashkan.hosseini
Stored procedure that generates insert stored procedure for tables
17 Nov 2009 by Asif Mushtaq
An alternative version of "SQL Get the last date of the month"
2 Feb 2011 by AspDotNetDev
Rather than use multiple subqueries to extract TOP 1 data, this shows you how to use a single TOP 1 JOIN.
9 Mar 2011 by AspDotNetDev
I like the original solution, especially when compared to this (which I am posting just to show that there are other solutions):-- Initialize table.CREATE TABLE #BigStrings( StringID bigint IDENTITY(1,1) NOT NULL, StringValue text NOT NULL, CONSTRAINT PK_BigStrings PRIMARY KEY...
18 Jul 2011 by AspDotNetDev
If you are the type that likes to debug production code, you can use SQL Profiler to find queries generated by your LINQ statements. This is a technique I recently used because it was so simple and did not require me to recompile anything.Note that StefanHam already posted this alternate...
20 Jul 2013 by AspDotNetDev
This query will show you all tables and columns in a database, and it can be pasted into Excel for easy manipulation.
15 Apr 2013 by atul123321
How to Encrypt And Decrypt a field without writing any frontent code .
3 Dec 2014 by Atul_Kapoor
Perform SQL Server Instance health check simultaneously on more than one server using Powershell
20 Nov 2014 by Avinash Narnaware
How to create Pivot Table in SQL Server 2008 R2 and in C# Linq to Entity Framework in a step by step manner with two different instances.
4 Aug 2012 by Azim Zahir
This tip demonstrates using the Select command to display a bar chart.
28 Jan 2014 by B. Clay Shannon
How to query Microsoft Access tables
8 Jan 2013 by Balaganesan Ravichandran
It works without affecting schema properties.
20 Sep 2014 by Baliram Suryawanshi
Pass OUTPUT parameter from stored procedure to SSIS Precendence Constraints
16 Aug 2012 by Balwant.mnd
My requirement is to convert a single column of a table to another multi column table with the save data that single column contained.
14 Jun 2013 by barry fat
develop a web based data dictionary
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}')
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
31 Aug 2015 by Bert O Neill
Execute SSIS Package in C# or SQL Sproc
8 Dec 2014 by Bertin @nonodata.com
It is often important to have general guidelines when putting together a Data Analysts Team.
7 Mar 2013 by BharatRamV
Converts XML to SQL statements and executes them.
20 Dec 2016 by BharatRamV
Finds the Best Table for a given set of columns
22 Mar 2016 by Bhawesh Tiwari
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager failed with error code 0xC0209303.
12 Jun 2013 by Bhushan W. Juare
This tip shows how to split a column in T-SQL.
9 Jul 2013 by Bhushan W. Juare
The different ways of retrieving XML data from SQL Server.
11 Jul 2013 by Bhushan W. Juare
This tip shows how to use SQLCMD utility in SQL Server 2008.
2 Dec 2012 by Bikash Karmokar
Connecting Windows Form Application With ADO.NET in C#
28 Feb 2016 by Bipin Paul
Implementation of Contact Us Page using ASP.NET MVC pattern
26 Nov 2011 by Biswa Bhusan Dash
SQL Server Stored Procedure
3 Jan 2012 by bluesathish
Fastest and most efficient method to insert large amount of records to a SQL Server database from our system generated datatable.
22 Jun 2014 by Bohdan Stupak
This tip will cover several interesting issues of SQL