SQL Server useful but less known features

  • Posted on: 2 November 2016
  • By: Michał Turecki
  1. Checking who is connected to the database

    sp_who

    SELECT
    NULL as [Connections by Database],
    [host_name] AS [Client Machine],
    db.name AS [Database],
    [program_name] AS [Client Program],
    COUNT(*) AS [Open Connections]
    FROM sys.dm_exec_sessions s (nolock)
    LEFT JOIN sys.dm_exec_requests r (nolock) ON r.session_id = s.session_id
    LEFT JOIN sys.databases db (nolock) ON db.database_id = r.database_id
    WHERE s.session_id >= 50 -- Ignore SQL Server processes
    GROUP BY [host_name], db.name, [program_name]
    ORDER BY [Client Machine], [Database], [Client Program]

  2. Adjusting connection pooling settings

    By default pool size is 100 per database with a command timeout (effectively a connection timeout) of 15 seconds. To increase add following to the connection string:

    Connection Timeout=30;Pooling='true';Max Pool Size=200

  3. Checking the size of column's contents

    To check how much data the column contains:

    SELECT *, DATALENGTH([column]) AS ColumnSizeInBytes FROM table

  4. Using SQL Server profiler

    Profiler is a powerful way to debug application performance problems, to check query execution time. If you're developing any application using SQL Server as a database, running it at least once for every application release can help with pinpointing possible performance issues. Remember the rule - there should be a constant number of queries regardless of the amount of records fetched - that way application will scale better. Sometimes it's better to replace a single complex query with more simpler queries because for each result row, columns shared by joins are repeated and delivered to client for processing many times.

Comments

free online casino games
free online casino
online casino real money
online casino
online casino reviews

free online casino games
free online casino
online casino real money
online casino
online casino reviews

free online casino games
free online casino
online casino real money
online casino
online casino reviews

free online casino games
online casino real money
online casino games
online casino
free online casino slots

free online casino games
online casino real money
online casino games
online casino
free online casino slots

free online casino games
online casino real money
online casino games
online casino
free online casino slots

Hello there! clomid online pharmacy buy valtrex 100 mg planet drugs direct beneficial web site

Hello there! walgreens online pharmacy buy valtrex usa international pharmacies that ship to the usa very good web page

In 2019 there are lot of movies are going to be released. Obviously, there are Avengers part 2, new Star Wars Episode nine and many others. These are films that every person wants to see, but sometimes you can miss it.It is where applications come in handy you can watch a movies for free. Btw, looking for the best app to watch free movies on your Android phone? Then your should check Showbox APK. This is the most famous app today that has a big library of tv shows and films. This app is also available for Windows users. But your need to download it first to enjoy free films Showbox download on PC

In 2019 there are lot of movies are going to be released. Obviously, there are Avengers part 2, new Star Wars Episode nine and many others. These are films that every person wants to see, but sometimes you can miss it.It is where applications come in handy you can watch a movies for free. Btw, looking for the best app to watch free movies on your Android phone? Then your should check Showbox APK. This is the most famous app today that has a big library of tv shows and films. This app is also available for Windows users. But your need to download it first to enjoy free films Showbox download on PC

In 2019 there are lot of movies are going to be released. Obviously, there are Avengers part 2, new Star Wars Episode nine and many others. These are films that every person wants to see, but sometimes you can miss it.It is where applications come in handy you can watch a movies for free. Btw, looking for the best app to watch free movies on your Android phone? Then your should check Showbox APK. This is the most famous app today that has a big library of tv shows and films. This app is also available for Windows users. But your need to download it first to enjoy free films Showbox download on PC

In 2019 there are lot of movies are going to be released. Obviously, there are Avengers part 2, new Star Wars Episode nine and many others. These are films that every person wants to see, but sometimes you can miss it.It is where applications come in handy you can watch a movies for free. Btw, looking for the best app to watch free movies on your Android phone? Then your should check Showbox APK. This is the most famous app today that has a big library of tv shows and films. This app is also available for Windows users. But your need to download it first to enjoy free films Showbox download on PC

free casino games online
casino online
online casino real money no deposit
free online casino
casino games online

free casino games online
casino online
online casino real money no deposit
free online casino
casino games online

free casino games online
casino online
online casino real money no deposit
free online casino
casino games online

Howdy! online pet pharmacy buy generic valtrex approved canadian online pharmacies good web site

Howdy! online pet pharmacy buy generic valtrex approved canadian online pharmacies good web site

Hi! india online pharmacy buy valtrex pills medications canada excellent site

Hi there! buy propecia no rx online pharmacy review forum osu cialis pagamento paypal excellent web site

Hi there! buy propecia no rx online pharmacy review forum osu cialis pagamento paypal excellent web site

Hi there! buy propecia no rx online pharmacy review forum osu cialis pagamento paypal excellent web site

Hi there! buy propecia no rx online pharmacy review forum osu cialis pagamento paypal excellent web site

Hello! finasteride accutane online pharmacy cialis ou viagra beneficial web page

Howdy! buy finasteride international online pharmacy daily cialis without a prescription beneficial web page

Howdy! buy finasteride international online pharmacy daily cialis without a prescription beneficial web page

Howdy! buy finasteride international online pharmacy daily cialis without a prescription beneficial web page

modafinil online pharmacy
generic viagra online pharmacy
online pharmacies canada review
best online pharmacy review
target pharmacy online

modafinil online pharmacy
generic viagra online pharmacy
online pharmacies canada review
best online pharmacy review
target pharmacy online

tramadol pharmacy online
viagra online canada pharmacy
best online pharmacy viagra
online discount pharmacy
online pharmacy no prescription

tramadol pharmacy online
viagra online canada pharmacy
best online pharmacy viagra
online discount pharmacy
online pharmacy no prescription

tramadol pharmacy online
viagra online canada pharmacy
best online pharmacy viagra
online discount pharmacy
online pharmacy no prescription

tramadol pharmacy online
viagra online canada pharmacy
best online pharmacy viagra
online discount pharmacy
online pharmacy no prescription

mexican pharmacies online
pharmacy tech school online
pharmacy tech classes online
hcg injections online pharmacy
norco online pharmacy

online pharmacy forum
vipps online pharmacy
best online pharmacy forum
trusted online pharmacy reviews
levitra online pharmacy

online pharmacy forum
vipps online pharmacy
best online pharmacy forum
trusted online pharmacy reviews
levitra online pharmacy

online canadian pharmacy review
walgreen online pharmacy
best canadian pharmacy online
pharmacy technician online program
international online pharmacy

online canadian pharmacy review
walgreen online pharmacy
best canadian pharmacy online
pharmacy technician online program
international online pharmacy

online canadian pharmacy review
walgreen online pharmacy
best canadian pharmacy online
pharmacy technician online program
international online pharmacy

buy propecia uk
buy propecia with no prescription
buy propecia uk
buy generic propecia
buy propecia usa

buy propecia pills
finasteride
purchase propecia online no prescription
buy propecia pills
buy propecia no rx

buy propecia pills
finasteride
purchase propecia online no prescription
buy propecia pills
buy propecia no rx

buy propecia pills
finasteride
purchase propecia online no prescription
buy propecia pills
buy propecia no rx

buy propecia pills
finasteride
purchase propecia online no prescription
buy propecia pills
buy propecia no rx

buy propecia pills
buy propecia uk
buy propecia no prescription
buy propecia
buy generic propecia

buy propecia pills
buy propecia uk
buy propecia no prescription
buy propecia
buy generic propecia

buy propecia pills
buy propecia uk
buy propecia no prescription
buy propecia
buy generic propecia

Pages