SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Querying Microsoft SQL Server

I am a technology enthusiast and software developer by profession. I am developing .Net/database based enterprise applications from past 3 years.

My skills includes C# ,ASP.NET,SQL Server 2008 and MVC . My areas of interests are database development and application software development using Microsoft Technologies.

Archives: February 2013

Search all running SQL Server instances over LAN

Sometimes you need to know how many and what instances of SQL Server running in your organization over Network. You can easily see in simple steps
  •    Go to SSMS.
  •    Object Explorer
  •    Click on Connect

  •      Go to Server Name Dropdown and Select Browse…

Read more

0 comments, 1,978 reads

Posted in Querying Microsoft SQL Server on 22 February 2013

Generate Random Passwords using T-SQL

Use following script to generate random Passwords

DECLARE @id int,
@list varchar
SET @list = 'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ23456789.,-_!$@#%^&*'
select replace(SUBSTRING(CONVERT(varchar(255), NEWID()),8, 8),'-','') as RANDOM


Suppose you have a table tblUser with columns

Read more

7 comments, 3,244 reads

Posted in Querying Microsoft SQL Server on 12 February 2013

Handling Null Values in SQL Server

What is NULL?

In SQL, A Null is an unknown or undefined value. Some interesting operations on NULL.

--query                 --result
select 3*NULL      --NULL
select 3+NULL      --NULL
select NULL/0      --NULL
select 'queryingsql' where null=null --Null never be equal to Null unless SET ANSI_NULLS OFF.

Now See…

Read more

0 comments, 510 reads

Posted in Querying Microsoft SQL Server on 5 February 2013

Frequently asked SQL Server Queries

Data to test:

CREATE TABLE [dbo].[emp](
      [emp_id] [nchar](10) NULL,
      [emp_name] [nchar](10) NULL,
      [salary] [int] NULL
 insert emp ( emp_id,emp_name,salary )  select '1','ABC',-20000
 insert emp (

Read more

2 comments, 726 reads

Posted in Querying Microsoft SQL Server on 4 February 2013