Click here to Skip to main content
15,885,366 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 Score

SQL 

5 Sep 2013 by Mubin M. Shaikh
Create time dimension with 24 hour plus values and time buckets in your data warehouse
13 Mar 2012 by Tecfield
This tip shows how to rename a database and its MDF and LDF files in SQL Server.
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.
15 Oct 2020 by RickZeeland
PostgreSQL notifications Windows Forms application
21 Oct 2013 by Member 7874525
This how you can monitor your database changes
28 May 2010 by DecodedSolutions.co.uk
This is a simple article describing how to create an add an outlook appointment to your MS Outlook Calender.
20 Nov 2012 by SEJohnson
Linking to an existing SQLDB in ASP MVC4.0 and EF5.x.
2 Sep 2015 by Peter Leow
Get your database to generate unique running IDs for your application
16 Mar 2012 by Anurag Gandhi
A Query to copy an individual table data between databases
11 Jan 2015 by Muhammad Hassan Tariq
Glimpse Extension for server side debugging and diagnostic information of ASP.NET applications
15 Mar 2017 by Ricardo_Torres_Torres
Read text file and insert mutiples records in just one SQL Sentence
6 Aug 2016 by Clifford Nelson
This tip presents a way to have disabled items in your ComboBox
8 Jul 2010 by Md. Marufuzzaman
How easy to read a file without using of the seven extended stored procedures.
16 Jan 2014 by Tom Glick Philadelphia, US
POC to demonstrate passing of collections of complex objects to ASP.NET Web API Controllers.
14 Aug 2010 by Roger Wright
A simple example of creating a new database on a SQl Server instance
19 Feb 2015 by DrABELL
Technique to extend capability of standard SQL by adding the Aggregate Product Function
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.
3 Nov 2013 by S. M. Ahasan Habib
I will explain here how to use table variable and over come cursor limitation
22 Oct 2014 by Kalvin Lawrence Ernst
Generate a web app instantly, directly from a database(SQL Server)
21 Sep 2015 by Sarathi Balakrishnan
Reset SQL server SA (System Admin) Password when you have lost all possible ways to connect to SQL server and your server has only Windows authentication disabled. You should have Windows administrator permission to do this.
14 Aug 2017 by Ehtesam Ahmed
This article gives you quick tip about how you can remove duplicate rows easily using common table expression in SQL
18 Mar 2019 by Martin Vorbrodt
SQL database access
22 Jul 2013 by Paw Jershauge
Want your own movie database??? Download IMDB in 20 minutes.
13 Oct 2016 by Wendelius
A little tip on how to format repeating values in SQL output using LAG function
3 Feb 2019 by Thinira
Continuous Integration and Delivery with VSTS (Visual Studio Team Services)
4 Apr 2021 by Rijwan Ansari
Learn about SQL Server Database Project (Template) available in VS
19 Feb 2019 by DiponRoy
How to do string split and join in SQL Server
23 Feb 2012 by Mahmud Hasan
How to use variable in SELECT TOP SQL command
6 Dec 2012 by Ravi Tuvar
Concatenate rows with comma separated string in SQL.
18 Sep 2015 by Wendelius
This tip shows how to calculate a difference between two datetime values and to express the difference in years, days, hours, minutes and so on.
20 Dec 2012 by Wendelius
This tip describes how to delete duplicate rows from a table that doesn't have a key.
8 Apr 2011 by Henry Minute
Or, there's always Scott Guthrie's LINQ To SQL Debug Visualizer[^].[Edit]While I'm posting links there is a nice utility that can output the generated SQL to the Debug Window in VS written by Kris Vandermotten.You can get it here[^].To use it: MyDataContext db = new...
9 Aug 2011 by Jesus Carroll
This brief article show how to install quickly Microsoft SQL Server 2008 Express Edition Standard or with Advanced Services
4 Feb 2012 by RasikaLB
You can find queries to find a specific string from MSSQL Server
1 May 2013 by Nasser Malik
Split comma separated IDs to get batch of records through Stored Procedure.
11 Oct 2013 by Brad Joss
A SQL String Split function for the real world
20 Feb 2014 by PallavSingh
Converting data column (contains OLE db image binary Format) to image file (.jpg)
7 Feb 2015 by Gaurav_Chaudhary
This tip is a brief introduction to Pivot operator in SQL Server
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.
1 Nov 2016 by O.Nasri
A good tutorial in how you can publish your ASP.NETCore MVC web application to IIS.
26 Apr 2018 by Mason Kuck
I walk you through how to make use Table-valued parameters with one value
2 Aug 2011 by thatraja
I'm using this way. SELECT * FROM VIEW. Consider the below Table has following fields(Including Non-display columns).Table...
23 Nov 2011 by Antonino Porcino
How to use T-SQL function SCOPE_IDENTITY() to retrieve inserted rows identity values with CommandBuilders and DataAdapters
17 Sep 2012 by aasim abdullah
Get all indexes list in detail, with their involved columns
17 Dec 2013 by Adittya Gupta
Table Value Parameters in SQL Server 2008 with ASP.NET.
15 Feb 2015 by Bohdan Stupak
This tip shows some primary issue which puts a serious limitation on SQL Server MONEY data type.
26 Dec 2015 by sandeepmittal11
Import Images to SQL Server Database using SSIS
31 Jan 2017 by #realJSOP
Using common table expressions to build data from thin air.
1 Oct 2018 by Satnam Singh CapGemini
Improving backup performance
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
15 Mar 2021 by Pablo A Martinez
How to use Google map and Spatial search to do freehand drawing
19 Jan 2010 by Manas Bhardwaj
Ever wondered that how to get a comma (pipe or whatever) seperated result for a column in a table.The following statement show a simple example you can take as a starting point.Select (Stuff((Select ', ' + FName From Accounts FOR XML PATH('')),1,2,''))
13 Apr 2012 by Elina Blank
Another option:declare @commaStringList varchar(max)set @commaStringList = ''select @commaStringList = @commaStringList + ', ' + CAST(ColumnName as VARCHAR) from MyTable -- remove leading commentif len(@commaStringList) > 3 set @commaStringList =...
17 Feb 2011 by John Gathogo
Catastrophic results associated with unqualified use of columns belonging to tables referenced on main query in a subquery
25 Jul 2011 by Rutvik Dave
I 100% agree with this.Another trick is *if possible* add audit columns at the time of creating/designing the database, i.e.:CreatedOnCreatedByLastModifiedOnLastModifiedByThis could prevent people from using Select *, because generally we don't display such information anywhere, and...
31 Aug 2014 by Wendelius
This tip demonstrates the use of LAG and LEAD functions in SQL Server.
11 Oct 2011 by Chris Maunder
A quick script to enable you to find the processes that are blocking in SQL server
16 Oct 2011 by Shivprasad koirala
If you want to quickly get index suggestions and improve performance in SQL Server, then Profiler and tuning wizard is the first place to start.
4 Apr 2012 by sluaghtered
Script Runner that can run multiple SQL script files on MS-SQL.
17 Aug 2012 by ManojKumar19
Update row column with another row column in same table SQL only if it is null.
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.
21 Jul 2014 by Phil Jeffrey
How to run a ClickOnce app as Administrator on Windows 8 when the app includes a SQL Compact database
30 Jul 2014 by DiponRoy
How to handle database scheme changes with normal SQL scripts, without migration in Entity Framework code first
22 Nov 2015 by Daniel Miller
This tip shows how to display the length of the longest string value in every table and column in your database.
15 Nov 2015 by sandeepmittal11
COALESCE in SQL Server
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
23 Jun 2016 by jonyj
Queries and commands to discover what's locking the database
7 Dec 2016 by Wendelius
This tip demonstrates how to select valid records from a table that contains validity date limits.
18 Dec 2016 by NightWizzard
Convert amounts to their spoken equivalents
1 Nov 2022 by Tomas@PawSQL
How to cope with all scenarios regarding NULL value handling in your daily work
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}')
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...
20 Apr 2011 by PIEBALDconsult
Using Reflection to instantiate a System.Data.SqlClient.SqlException
19 Apr 2011 by wizardzz
Time remaining of Database Shrink
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 Nov 2011 by Md. Marufuzzaman
Sorting column that contains string with numeric value
7 Jan 2012 by Dhananjay Kumar Upadhyay
Download SQL Server Sample Databases including SQL Server 2012
1 Jun 2016 by PIEBALDconsult
Interspersing 'Total' rows among summarized data rows in the correct order
13 Sep 2012 by CorvetteGuru
Backup Stored Procedures in SQL Server.
19 Feb 2013 by Rajesh Manjarekar
I found out that a possible cause is the difference between the SSIS 32 bits and 64 bits environment
5 May 2013 by mohammad amiri
Paging DataGridView using LINQ in C#.
14 Jul 2013 by OriginalGriff
If you have two (or more) tables which are interrelated, you sometimes need to update the rows of one table, selected from information in a different table. This isn't difficult, but is can take a little think about.
5 Sep 2013 by Mubin M. Shaikh
Manually Run SSRS Scheduled Reports
27 Jan 2017 by Rajesh_K_Sharma
How to create CSV file in SQL
31 Mar 2014 by h_wiedey
Usage of instead of triggers in Object-Relational (O/R) Mapping
8 Mar 2014 by SanSkun
How to bind holiday list and information about those holidays from database
14 Apr 2014 by Ankur .K. Vishwakarma
This tip shows you a T/SQL function to split a string concatenated by a delimiter.
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.
29 Dec 2015 by Daniel Miller
This tip provides a simple solution to automate the generation of entity and mapping classes for Entity Framework.
2 Jan 2016 by Tore Olav Kristiansen
If you need to change values of db table primary keys during ordinary operations, you probably have a design flaw in your software. In extraordinary situations, it may however be necessary. This tip helps you do so.
18 Feb 2016 by debashishPaul
How to Get 'serial' value of the Inserted Record and Use with a Variable in PostgreSQL
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.
31 Jan 2017 by saddam_msp
Shortcuts to execute your query faster while working or debugging T-SQL statement
13 May 2017 by Evgeniy Sukhikh
Issues and solutions taken while moving R from cmd to sp_execute_external_script
13 Jul 2017 by Wendelius
This is an alternative for "What’s the Difference between a Full Index Scan and a Fast Full Index Scan in Oracle?"
11 Jul 2018 by Satnam Singh CapGemini
Cannot Bulk Load Data Into the Table with Primary Key Constraint on it
8 Jan 2020 by E. Scott McFadden
This article explains how to create and use a self referencing key in a SQL Server Table.
14 Sep 2021 by OriginalGriff
How do you get last weeks data only? It's a little more complex than you might have thought