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

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

buy propecia online without prescription
buy propecia no prescription
finasteride
buy propecia cheap
where buy propecia

buy propecia online without prescription
buy propecia no prescription
finasteride
buy propecia cheap
where buy propecia

best best online pharmacy forum
testosterone best online pharmacy
best online pharmacy scams
walmart best online pharmacy
best online pharmacy no rx

best best online pharmacy forum
testosterone best online pharmacy
best online pharmacy scams
walmart best online pharmacy
best online pharmacy no rx

canadian pharmacy american express
mexican best online pharmacy
trusted best online pharmacy reviews
health pharmacy online
best online pharmacy oxycodone

cvs best online pharmacy
canadian pharmacy
alprazolam best online pharmacy
best online pharmacy forum
indian best online pharmacy

cvs best online pharmacy
canadian pharmacy
alprazolam best online pharmacy
best online pharmacy forum
indian best online pharmacy

cvs best online pharmacy
canadian pharmacy
alprazolam best online pharmacy
best online pharmacy forum
indian best online pharmacy

cvs best online pharmacy
canadian pharmacy
alprazolam best online pharmacy
best online pharmacy forum
indian best online pharmacy

buy generic levitra
buy levitra no rx
buy levitra 20 mg
order levitra
levitra online

buy vardenafil
buy levitra pills online
levitra 20mg
buy levitra no rx
purchase vardenafil

buy vardenafil
buy levitra pills online
levitra 20mg
buy levitra no rx
purchase vardenafil

need fast payday loan payday loan direct lender instant payday loans uk

modafinil online pharmacy
cvs pharmacy job application online
us pharmacy online
tramadol online pharmacy
canadian online pharmacy

payday loan shop bad credit loans no payday loans payday loans without teletrack

online pharmacy no prescription
mexican pharmacies online
vyvanse online pharmacy
canadian drugs
online pharmacy technician programs

online pharmacy no prescription
mexican pharmacies online
vyvanse online pharmacy
canadian drugs
online pharmacy technician programs

payday loans direct lender cash check one application payday loan

payday loans direct lender cash check one application payday loan

pharmacy tech training online
online pharmacy technician
online pharmacy no perscription
pharmacies online
canada pharmacy no prescription needed

online pharmacy hydrocodone
are online pharmacies legit
best canadian online pharmacy
canada pharmacy no prescription
india pharmacy online

online pharmacy hydrocodone
are online pharmacies legit
best canadian online pharmacy
canada pharmacy no prescription
india pharmacy online

free samples of cialis
free samples of cialis
cialis free trial
cialis coupon free trial
free cialis trial

free cialis voucher
cialis coupon 2017
cialis free samples
how to get cialis free
cialis com free trial

cialis com free offer
free cialis pills
cialis 30 day free trial
free cialis pills
free samples of cialis by mail

cialis com free offer
free cialis pills
cialis 30 day free trial
free cialis pills
free samples of cialis by mail

cialis com free offer
free cialis pills
cialis 30 day free trial
free cialis pills
free samples of cialis by mail

cialis com free offer
free cialis pills
cialis 30 day free trial
free cialis pills
free samples of cialis by mail

cialis free trial
free cialis trial online
cialis coupons
cialis daily use
cialis com free trial

Перезвоните мне пожалуйста 8 (953) 344-62-67 Антон.

viagra online generic viagra free samples generic viagra for sale

viagra online generic viagra free samples generic viagra for sale

free sample of viagra or cialis
free cialis coupon
cialis com free offer
cialis free sample
cialis free trial online

Pages