SQL samples and examples



You can make money from this site by posting original and quality articles that comply with Google AdSense policies.. Also, we offer several other reward programs including monthly profit sharing, cash rewards per post, contests & prizes etc to contributing members.

Submit Your Article

Articles

SQL User Friendly - Developer Friendly Queries

This article explains the list of user friendly/developer queries like selecting list of tables starting with specific letter, Searching for specific column in entire database, searching Sp, text and parameter names.

How to use Temporary table in Stored procedure with example

In this article I'm going to explain How to use Temporary table in Stored procedure with example and also I'm explain what is Temporary table and its types. Temporary table are create at run time and then you can do the all kind of operation like normal table.

Convert a file into zip using Stored Procedure in SQL

In this we can conver file into zip format using SQL and WINRAR and BATCH command. there are lot of ways to do this. but the simplest way is using 'XP_CMDShell' command.. xp_CMDShell can execute the shell/system command which includes the batch file.

How to interchange the values of two columns in sql

How to interchange the values of two columns in sql In this article I'm going to explain how to interchange column values in database table. In sql server there is no pre defined function for interchange column values.

SQL Function for String values

This article gives a sneak peek into the various SQL functions used for formatting string\varchar values.I hope this article will be useful to you as you can find all the string functions at one place with proper descriptions and examples.

Create Insert Stored Procedure Automatically in MS SQL

If you wanted to create insert procedure automatically then this code will help you. You just need to pass the Table name as parameter to this stored procedure. Learn how to Create Insert Stored Procedure Automatically in MS SQL.

Table Value Parameter (TVP) in SQL Server

This article summarize the use of Table Value Parameter (TVP) in stored procedures for DML operations. This list the advantages over the traditional way of passing multiple individual parameter as input.

How to call function from stored procedure in SQL Server?

In this article I'm going to explain how to call function from stored procedure in SQL Server. Here I have written a scalar function named AddionofTwoNumbers that accepts three input parameters and one output parameter. Now I want to call this function in Stored procedure.

A 'Handy Code' for all - Function that splits string

Database developers often need to split a string. When we need to do so we keep on searching online for the solution as we always look for a quick fix. This code snippet has the function that splits a string and returns the plain text. Also the snippet has the code block where we can format the string. Hope this code will be a very quick reference.

How to Generate New GUID Using SQL Server

How to Generate New GUID Using SQL Server? In this article I'm going to explain how to generate Random unique identifier in using sql query in sql server. By using NEWID() function you can generate a new Guid (uniqueidentifier) in sql server.

How to create table in sql server 2005?

In this article, I have mentioned syntax of sql server 2005. It will be helpful for SQL server 2005 beginners. Data Manipulation Language (DML) is easy to use and understand.

Submit Your Article