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

best online casino
best online casino
casino games
best online casino
casino games
play slots for real money united states
free online casino
casino online
best online casinos

best online casino
best online casino
casino games
best online casino
casino games
play slots for real money united states
free online casino
casino online
best online casinos

casino online
new online casinos accepting usa
real casino play for free
casino slots
best casino slots machine
online casino real money
best online casino
free casino games slot machines
casino online

list of casino slot machines
new online casinos accepting usa
best online casino
bovada casino
casino game
online casino
casino game
play casino
real casino play for free

free online casino slots
casino bonus codes
online casino real money
free casino games slot machines
casino online
best online casinos
new online casinos accepting usa
real casino play for free
casino bonus

free online casino slots
casino bonus codes
online casino real money
free casino games slot machines
casino online
best online casinos
new online casinos accepting usa
real casino play for free
casino bonus

casino online
online casinos
borgata online casino
play casino
casino online slots
borgata online casino
free casino games slot machines
new online casinos accepting usa
play casino

casino online
online casinos
borgata online casino
play casino
casino online slots
borgata online casino
free casino games slot machines
new online casinos accepting usa
play casino

Hello! cialis online beneficial web page.

Hello! cialis online beneficial web page.

Hello! cialis online beneficial web page.

Hi there! buy cialis cheap great internet site.

Hi there! buy cialis cheap great internet site.

casino online
online casino reviews
online casino real money no deposit
free online casino
online casino real money no deposit
resorts casino online
casino online
free online casino
online casino real money

Today almost everyone visits YT or any other video hosting provider to upload and watch videos, free movies and other stuff. But sometimes you want to download a videofile and the hosting doesn't allow you to do so. It's where Vidmate App is coming to help you out. It allows you to download a video from may services, including Youtube, Vimeo, Facebook and many other hosting services. To perform this you just need to open video page and click "download". Plus, the app is completely free of charge and easy in use! Download Vidmate from https://vidmateapp.pro now and start downloading your favourite movies to share them with your family!

Today almost everyone visits YT or any other video hosting provider to upload and watch videos, free movies and other stuff. But sometimes you want to download a videofile and the hosting doesn't allow you to do so. It's where Vidmate App is coming to help you out. It allows you to download a video from may services, including Youtube, Vimeo, Facebook and many other hosting services. To perform this you just need to open video page and click "download". Plus, the app is completely free of charge and easy in use! Download Vidmate from https://vidmateapp.pro now and start downloading your favourite movies to share them with your family!

Today almost everyone visits YT or any other video hosting provider to upload and watch videos, free movies and other stuff. But sometimes you want to download a videofile and the hosting doesn't allow you to do so. It's where Vidmate App is coming to help you out. It allows you to download a video from may services, including Youtube, Vimeo, Facebook and many other hosting services. To perform this you just need to open video page and click "download". Plus, the app is completely free of charge and easy in use! Download Vidmate from https://vidmateapp.pro now and start downloading your favourite movies to share them with your family!

Today almost everyone visits YT or any other video hosting provider to upload and watch videos, free movies and other stuff. But sometimes you want to download a videofile and the hosting doesn't allow you to do so. It's where Vidmate App is coming to help you out. It allows you to download a video from may services, including Youtube, Vimeo, Facebook and many other hosting services. To perform this you just need to open video page and click "download". Plus, the app is completely free of charge and easy in use! Download Vidmate from https://vidmateapp.pro now and start downloading your favourite movies to share them with your family!

Usa Pharmacy Online viagra Amoxicillin With Astma Viagra En Murcia

Usa Pharmacy Online viagra Amoxicillin With Astma Viagra En Murcia

free casino games online
online casino real money
free online casino slots
real online casino
free online casino
free casino games online
online casino reviews
watch casino online
online casino real money no deposit

free casino games online
online casino real money
free online casino slots
real online casino
free online casino
free casino games online
online casino reviews
watch casino online
online casino real money no deposit

Hello there! purchase tadalafil great web site.

Hello there! purchase tadalafil great web site.

Hello there! purchase tadalafil great web site.

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

Therefore, people direct more period online.
maxatin kaufen ohne rezept auf rechnung einnahme online bestellen ohne rezeptbust cream spa ebay predaj test forum cena sk ako uzivatviril booster buy xtrasize reviews what is pills amazon
Look to make a add to that are likely to increase a metabolism. Wild devised plants perhaps may be those whom are gathered from this particular wild.

Hello! mexico best online pharmacy beneficial web site http://onlinepharmaciescanadarx.com

Hello! mexico best online pharmacy beneficial web site http://onlinepharmaciescanadarx.com

Hello! mexico best online pharmacy beneficial web site http://onlinepharmaciescanadarx.com

Howdy! best best online pharmacy forum beneficial web page http://onlinepharmaciescanadarx.com

Howdy! best best online pharmacy forum beneficial web page http://onlinepharmaciescanadarx.com

Hello there! mexico best online pharmacy good web page http://trustonlinepharmacies.com

Hello there! mexico best online pharmacy good web page http://trustonlinepharmacies.com

Hello there! mexico best online pharmacy good web page http://trustonlinepharmacies.com

Pages