Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: December 2012

FOR XML Clause


FOR XML CLAUSE:  Sometimes we need to data in form of XML from Database.SQL Server provide FOR XML Clause. For XML clause returns result of query as XML.There are some options with FOR XML clause
  • Raw
  • Path
·         Auto
  • Elements(can be used with raw,auto,path)
  • Explicit

You will find…

Read more

0 comments, 156 reads

Posted in Querying Microsoft SQL Server on 26 December 2012

Find Nth highest salary using RANKING functions


Suppose you want to find nth highest salary from a table,Then you can use DENSE_RANK() function.Here i show some example that show results and i hope clear concept about ranking functions          

DENSE_RANK(),RANK(),ROW_NUMBER(),NTILE() in SQL Server:


CREATE TABLE [dbo].[Person1](
    …

Read more

2 comments, 212 reads

Posted in Querying Microsoft SQL Server on 19 December 2012

Partitioning Table in SQL Server:


Partitioning Table in SQL Server:
 When your database has large tables. Then partitioning will be beneficial in terms of performance, scalability and maintainability. Sql Server partitioning allows to spread data on various physical disks leveraging the concurrent performance of those disks to optimize query performance. 
To use partitioning we…

Read more

0 comments, 354 reads

Posted in Querying Microsoft SQL Server on 10 December 2012

Sending Querying Data on Mail as Attached File


Sending Querying Data on Mail:


Sometimes we need to send data fetched from query on mail automatically. You can 

create report and after running reports you can send mail data fetched from report.

Alternative is send query data on mail and schedule this job. Now you don’t need to 

run…

Read more

0 comments, 134 reads

Posted in Querying Microsoft SQL Server on 7 December 2012