Click here to Skip to main content
15,887,683 members
Everything / Database Development / SQL Server / SQL Server 2005

SQL Server 2005

SQL-Server-2005

Great Reads

by Wonde Tadesse
This tip/trick helps to set a default value for blob data type such as Image, VarBinary.
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
by Max Paulousky
This article presents the techniques and caveats of building Silverlight applications that can be notified about database state changes via polling duplex. WSHttp binding and CLR triggers are used to implement the solution as well.

Latest Articles

by Narapareddy Shyamprasad
SQL Dynamic Pivots
by Luca Astolfi
User defined procedure for make an HTML table from T-SQL Select statment
by JasonShort
Wouldn’t it be handy if you could use regular expressions (RegEx) in your SQL code?  You could do some really advanced queries through the ability to specify regular expressions rather than just the simple like % matching you normally use. SQL CLR can do that!
by Ebenezar John Paul
An Ideal Code Review Checklist that applies for most programming languages

All Articles

Sort by Updated

SQL Server 2005 

2 Feb 2018 by Luca Astolfi
User defined procedure for make an HTML table from T-SQL Select statment
20 Dec 2016 by BharatRamV
Finds the Best Table for a given set of columns
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.
25 Aug 2016 by Gene R. Browning
Generate random dates (and times if you like) for your test data environment.
9 Apr 2016 by NightWizzard
Handling for hex expressions and the trailing '}'
22 Feb 2016 by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
21 Jan 2016 by smirson
This is an alternative for "String splitting/tokenizing using T-SQL user defined function."
23 Dec 2015 by Md. Marufuzzaman
A simple tip/trick to get rows on n’th maximum number from a table
18 Dec 2015 by Md. Marufuzzaman
A simple example of Microsoft SQL Server Pad String
18 Dec 2015 by Md. Marufuzzaman
This tip shows you an easy way to split Microsoft SQL Server table row data.
19 Jun 2015 by ss9o9o9o
Transferring backup files from a remote SQL Server and Dynamic SQL Connection with Restore utility.
8 Jun 2015 by Diluka Wittahachchige
Creating SQL Server database project use in Visual Studio 2012 and maintain versions use in TFS
5 Jun 2015 by Dathuraj Pasarge
Know whether your databases are backed up successfully in the last 24 hours or not !!!
3 Dec 2014 by Atul_Kapoor
Perform SQL Server Instance health check simultaneously on more than one server using Powershell
18 Nov 2014 by qadirv
Quick C# console application to encrypt all your database stored procedures
23 Sep 2014 by SatyLepide
By analyzing log-in attempts on SQL server, admins can build the complete picture out of the sequence of events that led to compliance failure or unauthorized access.
2 Sep 2014 by Rohan Kishor Garud
RoundhousE (RH) is a database migrations engine that uses plain old SQL Scripts to transition a database from one version to another.
21 May 2014 by Arvind Singh Baghel
Import CSV or txt File Into SQL Server Using Bulk Insert.
12 Nov 2013 by Jobless Creature
CTE To find all the related nodes in a hierarcy
11 Nov 2013 by Rajat-Indiandotnet
Find column or Text in entire stored procedure
10 Nov 2013 by Rajat-Indiandotnet
A unique feature of SQL SERVER Loop with Go statement
9 Oct 2013 by Matthew Taylor
How to remove Microsoft SQL Server triggers associated with a custom schema.
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
19 Sep 2013 by Saral S Stalin
Explains how to run a script with higher priority to avoid it getting terminated in a deadlock situation.
5 Sep 2013 by Mubin M. Shaikh
Create time dimension with 24 hour plus values and time buckets in your data warehouse
30 Jul 2013 by Gauri Chodanker
6 Jun 2013 by Nelson Kosta Souto
Find text in Stored Procedures, View, Trigger, and Function.
6 May 2013 by Hernán Hegykozi
This tip explains how to calculate the Check Digit Vertical (CDV) and Horizontal (CDH) by SQL Server.
24 Apr 2013 by Surender Singh (CodeToastDev)
Custom StringPadding functions for SQL Server
19 Apr 2013 by aasim abdullah
The TOP clause is commonly used to get the top required rows from a result set. The beauty of this clause is that it can be used with the WITH TIES clause to retrieve all similar rows to a base result set.
19 Apr 2013 by aasim abdullah
Restore failure from Enterprise to Standard edition in SQL Server.
19 Apr 2013 by aasim abdullah
Automatic query execution at every instance startup.
29 Mar 2013 by Nandakishore G N
Example For Gridview RowCommand Event
25 Feb 2013 by salchichurria
Triki game created in SQL Server with triggers.
30 Jan 2013 by Yogesh Gulve
17 Jan 2013 by Tharaka MTR
This article describes the easiest way to create and process delimited row using SQL XQuery.
15 Jan 2013 by Wonde Tadesse
This tip/trick helps to set a default value for blob data type such as Image, VarBinary.
4 Jan 2013 by RahulAJoshi
Grouping dynamically on different columns in single query
3 Jan 2013 by Levente Kupás
CLR-addon for T-SQL DATE transformation and Split-String
20 Dec 2012 by Wendelius
This tip describes how to delete duplicate rows from a table that doesn't have a key.
13 Dec 2012 by Paw Jershauge
MS SQL system views, mapped over version.
10 Dec 2012 by sachin bankar
How to use the result set from a Stored Procedure in a Select statement.
27 Nov 2012 by Aadhar Joshi
Creating job in sql server which automates taking backup of all stored procedures and functions in physical drive.
1 Nov 2012 by aasim abdullah
You have place indexes but still queries are slow... are you facing bookmark lookup problem ???
1 Nov 2012 by aasim abdullah
A stored procedure can be called from another stored procedure as nested stored procedure. How to get a list of these stored procedures with their nested one
24 Oct 2012 by aasim abdullah
Backup and then restore of a database is a normal job for developers and DBAs. This script will be helpfull to findout, from which path, and which backup file a database was restored.
23 Oct 2012 by aasim abdullah
How to use DELETED and INSERTED virtual tables to capture data change in result of any INSERT, UPDATE or DELETE statement.
2 Oct 2012 by aasim abdullah
A simple query to get all databases size on a given instance.
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 ??
20 Sep 2012 by Sreedhar Puligundla
Simple steps to create SQL joins by using SQL Server 2008 Management Studio
17 Sep 2012 by aasim abdullah
Get all indexes list in detail, with their involved columns
17 Aug 2012 by ManojKumar19
Update row column with another row column in same table SQL only if it is null.
7 Aug 2012 by kennysun
encrypt all stored procedures in SQL server with powershell
25 Jul 2012 by Durgesh Swarnkar
Getting the count of records in a particular column.
23 Jul 2012 by Paul M Simpson
Expanding a string by inserting alternating single spaces between characters
20 Jul 2012 by Mr. Joydeep Das
What the effects of Ordering in Index
20 Jun 2012 by chetan dudhagara
How to Protect from SQL Injection in PhP based website
13 Jun 2012 by headshot9x
How to create ShoppingCart using Gridview in asp.net with code VB
29 May 2012 by Harsh Gandhi
Generate XML Using FOR XML ; Difference between different modes (AUTO, RAW, PATH, EXPLICIT) of FOR XML to generate XML in SQL Server
24 Apr 2012 by mkader
SQL scripts to insert File to BLOB field and export BLOB to File
11 Apr 2012 by jroughgarden
This is an alternative for "Encrypting all Stored Procedures of a Database".
27 Mar 2012 by SA - Hibbert
Return all records between two dates that include time in SQL.
16 Mar 2012 by Anurag Gandhi
A Query to copy an individual table data between databases
13 Mar 2012 by Tecfield
This tip shows how to rename a database and its MDF and LDF files in SQL Server.
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
23 Feb 2012 by Mahmud Hasan
How to use variable in SELECT TOP SQL command
18 Feb 2012 by Rishikesh_Singh
Generate Insert script to extract data
11 Feb 2012 by Jobless Creature
HH:MM Time format addition
10 Feb 2012 by Ramanujam Shankar
Find missing date periods from a table.
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
4 Feb 2012 by chetan virkar
Uploading Zip File in ASP.NET
15 Jan 2012 by Dhol Gaurav
Get Tables List With Its Dependent Tables Names
13 Jan 2012 by Robby Tendean
How to do SQL atomic operations on UPDATE and DELETE syntax.
5 Jan 2012 by Jobless Creature
Masking selected characters in SQL, hiding few characters
6 Nov 2011 by Ravi Tuvar
Installing SQL Server 2005 and 2008 in the same computer.
30 Sep 2011 by VDmitrovsky
1) You cann't drop any object in schemas other than dbo, so you MUST use sys.schemas system view properly.2) You cann't drop tables even in dbo schema if they are referenced by other ones, not dropped so far. Drop all FKs before tables.dva
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:
17 Aug 2011 by bmckuhen
16 Aug 2011 by thatraja
The below query can be used to get the record count of all tables in the current database.
16 Aug 2011 by Graham Cottle
Sometimes it is necessary to have the schema name included as well. I concatenate with the table name for my convenience, but it is not vital to do so.SELECT sys.sysindexes.rows, sys.schemas.name + '.' + sys.objects.nameFROM sys.objectsINNER JOIN sys.schemasON ...
10 Aug 2011 by Wendelius
Or simply:exec msdb..sp_help_jobsp_help_job (Transact-SQL)[^]
18 Jul 2011 by RaviRanjanKr
A tip enable you to learn how to use Column_Index instead of Column Name with Order by clause
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
2 May 2011 by pankajupadhyay29
A nice way to get aggregated value without group by
18 Apr 2011 by Costica U
The original solution has some issues. Check the following script:IF OBJECT_ID('tempdb..#salary') IS NOT NULL BEGIN DROP TABLE #salary ENDCREATE TABLE #salary ( Salary INT )INSERT INTO #salary(Salary) VALUES(5) -- 1INSERT INTO #salary(Salary)...
15 Mar 2011 by Kannan K R
select ExDate, SUM(case when Dept='A' then expense else 0 end)[Store A Expense],SUM(case when Dept='B' then expense else 0 end)[Store B Expense],SUM(case when Dept='C' then expense else 0 end)[Store C Expense]from expenseTable where Dept in ('A','B','C') group by ExDate
11 Mar 2011 by Feleke Feyissa
select * from(SELECT l.Prepared_Date as Prepared_Date , m.Material_Code as Material_Code ,n.Name as Name,n.Description as Description , m.Quantity as Quantity,n.Unit_Of_Measure as Unit_Of_Measure , m.Status as Status...
28 Feb 2011 by pankajupadhyay29
Nice and fast way for reporting
23 Feb 2011 by Kale Yogesh
SHRINKFILE and TRUNCATE Log File in SQL Server 2008
22 Feb 2011 by Costica U
Here is another solution:IF OBJECT_ID( 'tempdb..#TestTable' ) IS NOT NULL BEGIN DROP TABLE #TestTable ENDCREATE TABLE #TestTable ( Column1 varchar(1), Column2 int )INSERT INTO #TestTable VALUES ('A', 1);INSERT INTO #TestTable VALUES ('A', 1); --...
17 Feb 2011 by John Gathogo
Catastrophic results associated with unqualified use of columns belonging to tables referenced on main query in a subquery
16 Feb 2011 by thatraja
SELECT TOP 1 salaryFROM (SELECT DISTINCT TOP n salaryFROM employeeORDER BY salary DESC) aORDER BY salarywhere n > 1SQL SERVER – Find Nth Highest Salary of Employee – Query to Retrieve the Nth Maximum value[^]