Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Everything / database / SQL-Server / SQL-Server-2008

SQL-Server-2008

SQL-Server-2008

Great Reads

by Suresh Dasari's
Auto Generate Code (CRUD) for 3 Layered architecture (Entity, Data Access & Business Layer) with Stored Procedures based on table design.
by Rick Bassham
How to use the SqlChangeMonitor with the new MemoryCache class in .NET 4.0.
by Nikita D. Sinelnikov
HowTo: make the report background (elements) of Microsoft .NET Report (.rdlc) non-printable
by Gurdeep Singh Toor
A Complete Guide to develop aplication using MyGeneration code genration framework. We will develop a Meeting Room Booking web application in this Article.

Latest Articles

by Suresh Dasari's
Auto Generate Code (CRUD) for 3 Layered architecture (Entity, Data Access & Business Layer) with Stored Procedures based on table design.
by Rick Bassham
How to use the SqlChangeMonitor with the new MemoryCache class in .NET 4.0.
by Nikita D. Sinelnikov
HowTo: make the report background (elements) of Microsoft .NET Report (.rdlc) non-printable
by Gurdeep Singh Toor
A Complete Guide to develop aplication using MyGeneration code genration framework. We will develop a Meeting Room Booking web application in this Article.

All Articles

Sort by Score

SQL-Server-2008 

by Suresh Dasari's
Auto Generate Code (CRUD) for 3 Layered architecture (Entity, Data Access & Business Layer) with Stored Procedures based on table design.
by Nikita D. Sinelnikov
HowTo: make the report background (elements) of Microsoft .NET Report (.rdlc) non-printable
by Md. Marufuzzaman
A simple tip/trick to get rows on n’th maximum number from a table
by Md. Marufuzzaman
A simple example of Microsoft SQL Server Pad String
by Chris Maunder
Timing SQL calls with millisecond accuracy
by Rajat-Indiandotnet
A unique feature of SQL SERVER Loop with Go statement
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…”
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.
by Hernán Hegykozi
This tip will show how to perform a backup and restore database from an application in VB.NET 2010.
by Heino Zunzer
The possibility to build stored procedures with table-valued parameters is a great new feature in SQL Server 2008, especially if utilized with the also newly implemented MERGE-command. Alas, there are some restrictions (TVPs have to be bound to a User-defined Table Type, have to be passed as...
by Hiren solanki
Building hirarchy in the sense of hirarchy of manager, employee though both are an employee of an enterprise but both are related or depend on hierarchical level.
by Hernán Hegykozi
This tip explains how to calculate the Check Digit Vertical (CDV) and Horizontal (CDH) by SQL Server.
by Levente Kupás
CLR-addon for T-SQL DATE transformation and Split-String
by Jobless Creature
CTE To find all the related nodes in a hierarcy
by Ramanujam Shankar
Using COALESCE function - concatenate many rows into a single text string output in SQL Server.
by e-Lopes
How to concatenate many rows into a single text string using SQL Server 2008.
by Sanjay K. Gupta
How to concatenate many rows into a single text string using SQL Server 2008
by PIEBALDconsult
See also Stupid CTE tricks -- string concatenation[^]
by Anurag Gandhi
A Query to copy an individual table data between databases
by Mubin M. Shaikh
Create time dimension with 24 hour plus values and time buckets in your data warehouse
by Rajesh_K_Sharma
How to create CSV file in SQL
by markkang
This tip describes how to generate insert SQL statement from the records in an existing table in SQL server database
by Aadhar Joshi
Creating job in sql server which automates taking backup of all stored procedures and functions in physical drive.
by Diluka Wittahachchige
Creating SQL Server database project use in Visual Studio 2012 and maintain versions use in TFS
by Darek Danielewski
This article demonstrates how to safely dequeue items from a shared table
by Member 10872251
Cascading DropDownList in ASP.NET MVC
by Bob Crowley
How to use a CASE statement in ORDER BY to avoid dynamic SQL
by kennysun
encrypt all stored procedures in SQL server with powershell
by Debopam Pal
How to bring data from Entity model to Excel file using LINQ.
by IkhwanKrisnadi
How to execute SQL Query / SQL Command on SQL Server using command prompt.
by manish76235
SQLCMD can be used to login to the Sql Server as well. One can only provide Server address, User Name and Password at the command prompt and press enter.The command prompt will change to 1>. Now any sql query can typed and by pressing enter in the next prompt a GO command and pressing enter...
by Alexander Konstantinov
Two stored procedures helping developers do less things when they create tables and indeces
by S.P.Tiwari
Find all the days between two dates using SQL Server
by Ramanujam Shankar
Find missing date periods from a table.
by Nelson Kosta Souto
Find text in Stored Procedures, View, Trigger, and Function.
by Saral S Stalin
Simple query to find the available hard disk space in the server
by Muhammad Aqib Shehzad
Forgot Password and Email Check from Database
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
by Tharaka MTR
This article describes the easiest way to create and process delimited row using SQL XQuery.
by Purushotham Agaraharam
Creating a parameterised report using SSRS.
by Md. Marufuzzaman
Get accurate age by date using MS SQL Server
by Trung Nguyen Son
How to analyse and tune your dotnetnuke site to get best performance.
by Md. Marufuzzaman
This is a very simple use of SQL Server global variables. Microsoft SQL Server provides a massive number of global variables, which are very effective to use in our regular Transact-SQL. Global variables represent a special type of variable. The server always maintain the values of these...
by Dhol Gaurav
Get Tables List With Its Dependent Tables Names
by Mahmud Hasan
How to use variable in SELECT TOP SQL command
by vikram.mahapatra
How to get the current time from any time zone
by RahulAJoshi
Grouping dynamically on different columns in single query
by Omar Frometa
Grouping Sets is the new SQL Server 2008 Operator
by Ameet Parse
This article describes How to find a Text in Stored Procedure (Checked on SQL Server 2008)
by Rajat-Indiandotnet
Find column or Text in entire stored procedure
by Kale Yogesh
How to Partition Table in SQL
by Shao Voon Wong
How to prevent SQL injection attacks when using dynamic SQL in stored procedures
by Wendelius
This tip describes how to delete duplicate rows from a table that doesn't have a key.
by Ron sikander
Find out the number of duplicates in the table:select count(*), VISTX_ST_FIPS,VISTX_CTY_FIPS,VISTX_TC from TR00.NV_STARTER_INDEXgroup by VISTX_ST_FIPS,VISTX_CTY_FIPS,VISTX_TC having count(*)>1--- Delele them using following statementDELETEFROM TR00.NV_STARTER_INDEXWHERE...
by SA - Hibbert
Return all records between two dates that include time in SQL.
by Wonde Tadesse
This tip/trick helps to set a default value for blob data type such as Image, VarBinary.
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.
by Md. Marufuzzaman
This tip shows you an easy way to split Microsoft SQL Server table row data.
by Kumar Pankaj Verma
Truncating log file in SQL Server using T-SQL when log file is too large and database becomes unresponsive.
by ManojKumar19
Update row column with another row column in same table SQL only if it is null.
by Bojjaiah
Single Stored Procedure for delete/retrieve all table of records
by Aqeeel
Identifying and deleting duplicate records from SQL Server Table
by Arvind Singh Baghel
Import CSV or txt File Into SQL Server Using Bulk Insert.
by Mr. Joydeep Das
What the effects of Ordering in Index
by RickZeeland
Inno Setup script to install SQL Server 2008 R2 with Tools, creating an instance with special rights and displaying the log.
by Mubin M. Shaikh
Create Named Query in Data Source View While Designing OLAP Cube in SSAS
by Chris Maunder
A quick script to enable you to find the processes that are blocking in SQL server
by Chris Maunder
Here's an alternate version that doesn't use sp_who yet provides a little more information. It also provides the option to kill the blocking processes themself.IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ListBlocking]') AND type in (N'P', N'PC'))EXEC...
by Chamila Nishantha
Simple query to get table column name as rows
by PIEBALDconsult
This is an alternative for "List SQL Server table column name as rows"
by Wendelius
This is an alternative for "List SQL Server table column name as rows".
by Paw Jershauge
MS SQL system views, mapped over version.
by sluaghtered
Script Runner that can run multiple SQL script files on MS-SQL.
by Paw Jershauge
Want your own movie database??? Download IMDB in 20 minutes.
by Tom Glick Philadelphia, US
POC to demonstrate passing of collections of complex objects to ASP.NET Web API Controllers.
by #realJSOP
It doesn't always happen the way you expect.
by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
by Subha.N
Tip to create a database application using C# .NET in the shortest time possible.
by Gene R. Browning
Generate random dates (and times if you like) for your test data environment.
by Md. Marufuzzaman
How easy to read a file without using of the seven extended stored procedures.
by Tecfield
This tip shows how to rename a database and its MDF and LDF files in SQL Server.
by Yogesh Gulve
Return Comma Separated String using SQL
by SonuKSingh
rowversion datatype in SQL Server: Track which row has been modified
by Mubin M. Shaikh
Manually Run SSRS Scheduled Reports
by IkhwanKrisnadi
How to solve when saving changes is not permitted on SQL Server 2008 Management Studio
by Luca Astolfi
User defined procedure for make an HTML table from T-SQL Select statment
by Saral S Stalin
Explains how to run a script with higher priority to avoid it getting terminated in a deadlock situation.
by headshot9x
How to create ShoppingCart using Gridview in asp.net with code VB
by Mehdy Moini
Implementing a map as a tree, and finding the shortest path, between the streets, is what you will see.
by SERokon
Exclude Column from SELECT * statement
by bmckuhen
How to get a quick list of all DBs using SMO
by Anurag Gandhi
I have gone through a lot of examples to sort alpha numeric data in sql. Here is my way:
by db_developer
Split User Defined Function, MS SQL Server 2008
by Glagace_7763
Create a table from a Varchar list value
by Robby Tendean
How to do SQL atomic operations on UPDATE and DELETE syntax.
by Rajesh Manjarekar
When CDC is turned ON against a table and the underlying table schema changes, such as adding/removing a column, changing datatype etc
by Mr.Thursday
SQL script for creating ASP.Net Identity Database
by mkader
SQL scripts to insert File to BLOB field and export BLOB to File
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.
by Ganu Sharma
Loop through/split a delimited string.
by Dathuraj Pasarge
Know whether your databases are backed up successfully in the last 24 hours or not !!!
by Atul_Kapoor
Perform SQL Server Instance health check simultaneously on more than one server using Powershell
by Dimitri Witkowski
Recently I had a problem: I was developing a logon trigger for SQL Server, and there was a bug in it. After deploying the trigger to the server he didn't allow me to login anymore. I was in panic and thought I would have to reinstall SQL Server.Fortunately, I've found a solution how to...
by aasim abdullah
Using SQL Server Management Studio, have you ever come a cross following questions: Why every time, a new query window is open with MASTER database.? On opening SQL Server Management Studio, I need a new query window automatically ?
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
by Surender Singh (CodeToastDev)
Custom StringPadding functions for SQL Server
by aasim abdullah
Automatic query execution at every instance startup.
by aasim abdullah
You have place indexes but still queries are slow... are you facing bookmark lookup problem ???
by aasim abdullah
How to use DELETED and INSERTED virtual tables to capture data change in result of any INSERT, UPDATE or DELETE statement.
by aasim abdullah
A simple query to get all databases size on a given instance.
by aasim abdullah
Get all indexes list in detail, with their involved columns
by aasim abdullah
How to Refresh Intellisense Cache in SQL Server
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 ??
by aasim abdullah
Restore failure from Enterprise to Standard edition in SQL Server.
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.
by Rajesh Manjarekar
How do I set FileSpec dynamically for looping files in a foreach loop container?
by mparvez
How to load data from an Excel file to load in a dimension table in an incremental way.
by Jesus Carroll
This brief article show how to install quickly Microsoft SQL Server 2008 Express Edition Standard or with Advanced Services
by smirson
This is an alternative for "String splitting/tokenizing using T-SQL user defined function."
by Irfan Baig
String splitting/tokenizing using T-SQL user defined function.
by Hajo Messner
There is a little inconsistence in this function, because the @Tokens Elements and the @Delimiter parameter are of data type NVARCHAR (=Unicode) while the @String parameter is of data type VARCHAR (=ANSI). If the @String parameter can be Unicode, it must be declared as NVARCHAR. If the @String...
by BharatRamV
Finds the Best Table for a given set of columns
by Jaime Olivares
How to Insert or Update an SqlGeography object in SQL Server 2008 from a C# application
by Syed Moula Ali
Replicate/Clone/Duplicate selected data in a Table using merge statment
by zvin
When comparing data stored in databases, you don't need to use RTRIM()
by salchichurria
Triki game created in SQL Server with triggers.
by Paul M Simpson
Expanding a string by inserting alternating single spaces between characters
by Mannava Siva Aditya
Uploading an image and displaying it on the UI page
by John Gathogo
Catastrophic results associated with unqualified use of columns belonging to tables referenced on main query in a subquery
by DrABELL
Generate large data series by using Cartesian Product and small data table
by Gordon Kushner
By using recursion (and CROSS JOINS), you can generate data without looping or hard-coding INSERT statements into a temporary table.In the example below, you can use recursion to generate a week of scheduling data for three employees. -- Count variable, set to 7 for a week's worth of...
by rakesh1503
Writeback and writethrough using C# with SQL Server 2008 SSAS.