SQL Server useful but less known features
-
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] -
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
-
Checking the size of column's contents
To check how much data the column contains:
SELECT *, DATALENGTH([column]) AS ColumnSizeInBytes FROM table
-
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
VirgilStots (not verified)
Mon, 08/07/2019 - 03:22
Permalink
online pharmacy technician programs 466 mg
Howdy! pharmacy technician online courses great site
Brettirrix (not verified)
Mon, 08/07/2019 - 03:22
Permalink
kgavz9zh
Citalopram
MiltonSOR (not verified)
Mon, 08/07/2019 - 03:19
Permalink
viagra 100mg 321 mg
Hello! buy viagra medication very good web site
VirgilStots (not verified)
Mon, 08/07/2019 - 03:17
Permalink
online pharmacy technician programs 466 mg
Howdy! pharmacy technician online courses great site
VirgilStots (not verified)
Mon, 08/07/2019 - 03:15
Permalink
online pharmacy technician programs 466 mg
Howdy! pharmacy technician online courses great site
MiltonSOR (not verified)
Mon, 08/07/2019 - 03:14
Permalink
viagra 100mg 321 mg
Hello! buy viagra medication very good web site
MiltonSOR (not verified)
Mon, 08/07/2019 - 03:10
Permalink
viagra 100mg 321 mg
Hello! buy viagra medication very good web site
LesKern (not verified)
Sun, 07/07/2019 - 05:06
Permalink
Propecia While On Accutane Drug LesKern
Para Que Sirve El Viagra Yahoo Price Canada Buy Propecia generic viagra Impotencia Propecia Propecia Treatments Buy Nexium Esomeprazole
LesKern (not verified)
Sun, 07/07/2019 - 04:58
Permalink
Propecia While On Accutane Drug LesKern
Para Que Sirve El Viagra Yahoo Price Canada Buy Propecia generic viagra Impotencia Propecia Propecia Treatments Buy Nexium Esomeprazole
RebImparf (not verified)
Sun, 07/07/2019 - 02:39
Permalink
Propecia Side Effects Long Term All Prescription Kelattict
Viagra Generic Dealers In Canada Generique Finasteride viagra Acheter Cialis Pharmacie France Diclofenac Buy Online
RebImparf (not verified)
Sun, 07/07/2019 - 02:36
Permalink
Propecia Side Effects Long Term All Prescription Kelattict
Viagra Generic Dealers In Canada Generique Finasteride viagra Acheter Cialis Pharmacie France Diclofenac Buy Online
RebImparf (not verified)
Sun, 07/07/2019 - 02:31
Permalink
Propecia Side Effects Long Term All Prescription Kelattict
Viagra Generic Dealers In Canada Generique Finasteride viagra Acheter Cialis Pharmacie France Diclofenac Buy Online
RebImparf (not verified)
Sun, 07/07/2019 - 02:25
Permalink
Propecia Side Effects Long Term All Prescription Kelattict
Viagra Generic Dealers In Canada Generique Finasteride viagra Acheter Cialis Pharmacie France Diclofenac Buy Online
Michaelexpor (not verified)
Fri, 05/07/2019 - 13:59
Permalink
buy propecia cvs 486 mg
Hello there! best place to order propecia great internet site.
Michaelexpor (not verified)
Fri, 05/07/2019 - 13:56
Permalink
buy propecia cvs 486 mg
Hello there! best place to order propecia great internet site.
Michaelexpor (not verified)
Fri, 05/07/2019 - 13:54
Permalink
buy propecia cvs 486 mg
Hello there! best place to order propecia great internet site.
Michaelexpor (not verified)
Fri, 05/07/2019 - 13:46
Permalink
buy propecia cvs 486 mg
Hello there! best place to order propecia great internet site.
Stewartskist (not verified)
Fri, 05/07/2019 - 10:21
Permalink
34m8f7m2
BUY AMOXICILLIN
Stepplups (not verified)
Thu, 04/07/2019 - 21:52
Permalink
Keflex 500mg 3 Times A Day Elllayego
Low Cost Alternatives And Viagra cheap cialis online Viagra Foros Cialis Spedizione 24 Ore
Stepplups (not verified)
Thu, 04/07/2019 - 21:47
Permalink
Keflex 500mg 3 Times A Day Elllayego
Low Cost Alternatives And Viagra cheap cialis online Viagra Foros Cialis Spedizione 24 Ore
Michaelexpor (not verified)
Thu, 04/07/2019 - 20:57
Permalink
cheap propecia online uk 482 mg
Hi there! cheapest way to buy propecia very good web page.
Michaelexpor (not verified)
Thu, 04/07/2019 - 20:54
Permalink
cheap propecia online uk 482 mg
Hi there! cheapest way to buy propecia very good web page.
Michaelexpor (not verified)
Thu, 04/07/2019 - 20:48
Permalink
cheap propecia online uk 482 mg
Hi there! cheapest way to buy propecia very good web page.
Michaelexpor (not verified)
Thu, 04/07/2019 - 20:44
Permalink
cheap propecia online uk 482 mg
Hi there! cheapest way to buy propecia very good web page.
Michaelexpor (not verified)
Thu, 04/07/2019 - 03:06
Permalink
buy non generic propecia 408 mg
Hi! where can i buy propecia in the us very good web site.
Michaelexpor (not verified)
Thu, 04/07/2019 - 03:00
Permalink
buy non generic propecia 408 mg
Hi! where can i buy propecia in the us very good web site.
Michaelexpor (not verified)
Thu, 04/07/2019 - 02:55
Permalink
buy non generic propecia 408 mg
Hi! where can i buy propecia in the us very good web site.
Michaelexpor (not verified)
Thu, 04/07/2019 - 02:52
Permalink
buy non generic propecia 408 mg
Hi! where can i buy propecia in the us very good web site.
Stepplups (not verified)
Wed, 03/07/2019 - 16:39
Permalink
Levitra 10 Mg Prezzo Elllayego
Cialis Nombre Generico Cod Direct Bentyl Next Day Medicine Mastercard Accepted Buy Kamagra Oral Jelly brand levitra canada Sildenafil Tablets To Buy Cialis 5mg Prix Pharmacie
Stepplups (not verified)
Wed, 03/07/2019 - 16:28
Permalink
Levitra 10 Mg Prezzo Elllayego
Cialis Nombre Generico Cod Direct Bentyl Next Day Medicine Mastercard Accepted Buy Kamagra Oral Jelly brand levitra canada Sildenafil Tablets To Buy Cialis 5mg Prix Pharmacie
Brettirrix (not verified)
Wed, 03/07/2019 - 11:05
Permalink
dz6f49g9
prednisone erythromycin buy wellbutrin lexapro prices where can i buy tetracycline
Josephlam (not verified)
Wed, 03/07/2019 - 02:10
Permalink
buy real propecia online 267 mg
Howdy! buy propecia online without prescription excellent website
Josephlam (not verified)
Wed, 03/07/2019 - 02:02
Permalink
buy real propecia online 267 mg
Howdy! buy propecia online without prescription excellent website
Josephlam (not verified)
Wed, 03/07/2019 - 02:00
Permalink
buy real propecia online 267 mg
Howdy! buy propecia online without prescription excellent website
Josephlam (not verified)
Wed, 03/07/2019 - 01:58
Permalink
buy real propecia online 267 mg
Howdy! buy propecia online without prescription excellent website
Lucasglurb (not verified)
Tue, 02/07/2019 - 16:50
Permalink
online pharmacy tramadol 350 mg
Hello! online indian pharmacy good web site.
Lucasglurb (not verified)
Tue, 02/07/2019 - 16:48
Permalink
online pharmacy tramadol 350 mg
Hello! online indian pharmacy good web site.
Lucasglurb (not verified)
Tue, 02/07/2019 - 16:45
Permalink
online pharmacy tramadol 350 mg
Hello! online indian pharmacy good web site.
Lucasglurb (not verified)
Tue, 02/07/2019 - 16:42
Permalink
online pharmacy tramadol 350 mg
Hello! online indian pharmacy good web site.
Antionesub (not verified)
Tue, 02/07/2019 - 12:41
Permalink
pharmacy online canada 281 mg
Hi! remote consultation online pharmacies excellent internet site.
Antionesub (not verified)
Tue, 02/07/2019 - 12:38
Permalink
pharmacy online canada 281 mg
Hi! remote consultation online pharmacies excellent internet site.
Antionesub (not verified)
Tue, 02/07/2019 - 12:34
Permalink
pharmacy online canada 281 mg
Hi! remote consultation online pharmacies excellent internet site.
Antionesub (not verified)
Tue, 02/07/2019 - 12:32
Permalink
pharmacy online canada 281 mg
Hi! remote consultation online pharmacies excellent internet site.
Antionesub (not verified)
Mon, 01/07/2019 - 15:29
Permalink
methadone online pharmacy 376 mg
Hi! generic viagra online canada pharmacy good site.
Antionesub (not verified)
Mon, 01/07/2019 - 15:22
Permalink
methadone online pharmacy 376 mg
Hi! generic viagra online canada pharmacy good site.
Antionesub (not verified)
Mon, 01/07/2019 - 15:18
Permalink
methadone online pharmacy 376 mg
Hi! generic viagra online canada pharmacy good site.
Antionesub (not verified)
Mon, 01/07/2019 - 15:15
Permalink
methadone online pharmacy 376 mg
Hi! generic viagra online canada pharmacy good site.
Lucasglurb (not verified)
Mon, 01/07/2019 - 12:58
Permalink
adderall online pharmacy 275 mg
Hello! online pharmacy viagra generic excellent internet site.
Lucasglurb (not verified)
Mon, 01/07/2019 - 12:56
Permalink
adderall online pharmacy 275 mg
Hello! online pharmacy viagra generic excellent internet site.
Lucasglurb (not verified)
Mon, 01/07/2019 - 12:53
Permalink
adderall online pharmacy 275 mg
Hello! online pharmacy viagra generic excellent internet site.
Pages