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

Hello there,

I am Anthony & I’m currently working on an online campaign with a client who would be interested to post an article on your website. The article would discuss topics relevant to your readership and include a natural link to my client’s website.

If you’re interested in guest post collaboration, please provide your pricing information through the form below or get in touch for more information.

Provide Your Website Details: https://forms.gle/dZDaMutecFpyehAZ6

If you run more potential sites, feel free to submit all your worthy sites.

Looking forward to hearing from you.

Thanks & Regards

Anthony Smith

Outreach Executive

Hello there,

I am Anthony & I’m currently working on an online campaign with a client who would be interested to post an article on your website. The article would discuss topics relevant to your readership and include a natural link to my client’s website.

If you’re interested in guest post collaboration, please provide your pricing information through the form below or get in touch for more information.

Provide Your Website Details: https://forms.gle/dZDaMutecFpyehAZ6

If you run more potential sites, feel free to submit all your worthy sites.

Looking forward to hearing from you.

Thanks & Regards

Anthony Smith

Outreach Executive

Hello there,

I am Anthony & I’m currently working on an online campaign with a client who would be interested to post an article on your website. The article would discuss topics relevant to your readership and include a natural link to my client’s website.

If you’re interested in guest post collaboration, please provide your pricing information through the form below or get in touch for more information.

Provide Your Website Details: https://forms.gle/dZDaMutecFpyehAZ6

If you run more potential sites, feel free to submit all your worthy sites.

Looking forward to hearing from you.

Thanks & Regards

Anthony Smith

Outreach Executive

Odzyskiwanie danych Warszawa świadczy usługi przywracania dostępu do sformatowanych danych po jakichkolwiek rodzajach uszkodzeń nośników, jak: zniszczenia logiczne typu problemy z partycją. Wejdź tutaj aby zapoznać się z informacjami dotyczącymi odzyskiwania danych

Ритуальные услуги

Hello there! us online pharmacy beneficial web site.

Hello there! us online pharmacy beneficial web site.

Hello there! us online pharmacy beneficial web site.

Hello there! us online pharmacy beneficial web site.

Howdy! pharmacy tech school online beneficial website

Howdy! pharmacy tech school online beneficial website

Howdy! pharmacy tech school online beneficial website

Howdy! pharmacy tech school online beneficial website

Hi! french pharmacy online beneficial web page

Hi! french pharmacy online beneficial web page

Hi! french pharmacy online beneficial web page

Hi! french pharmacy online beneficial web page

i need money desperately
loans for 18 year olds
cash loans today
same day loans bad credit
loan with bad credit
how to get a loan from the bank
same day cash loans
fast loans with bad credit
payday loan places near me
small loan bad credit
getting a personal loan
parent loan
american cash loans

i need money desperately
loans for 18 year olds
cash loans today
same day loans bad credit
loan with bad credit
how to get a loan from the bank
same day cash loans
fast loans with bad credit
payday loan places near me
small loan bad credit
getting a personal loan
parent loan
american cash loans

i need money desperately
loans for 18 year olds
cash loans today
same day loans bad credit
loan with bad credit
how to get a loan from the bank
same day cash loans
fast loans with bad credit
payday loan places near me
small loan bad credit
getting a personal loan
parent loan
american cash loans

unsecured loan
quick loan bad credit
apply personal loan
3000 loan
direct lenders
loans for poor credit
i need money today
payday loans with bad credit
e z money payday loans
pay day loans direct lenders
personal cash loans
top ten payday loans
loans with monthly payments

unsecured loan
quick loan bad credit
apply personal loan
3000 loan
direct lenders
loans for poor credit
i need money today
payday loans with bad credit
e z money payday loans
pay day loans direct lenders
personal cash loans
top ten payday loans
loans with monthly payments

unsecured loan
quick loan bad credit
apply personal loan
3000 loan
direct lenders
loans for poor credit
i need money today
payday loans with bad credit
e z money payday loans
pay day loans direct lenders
personal cash loans
top ten payday loans
loans with monthly payments

unsecured loan
quick loan bad credit
apply personal loan
3000 loan
direct lenders
loans for poor credit
i need money today
payday loans with bad credit
e z money payday loans
pay day loans direct lenders
personal cash loans
top ten payday loans
loans with monthly payments

how to get personal loan
payday loans bad credit direct lender
can i get a loan with bad credit
secure loan
holiday loans
legit payday loans
kwikcash
lend money
payday loans in maryland
take out a loan
goverment loans
small cap funds
payday loans houston

how to get personal loan
payday loans bad credit direct lender
can i get a loan with bad credit
secure loan
holiday loans
legit payday loans
kwikcash
lend money
payday loans in maryland
take out a loan
goverment loans
small cap funds
payday loans houston

how to get personal loan
payday loans bad credit direct lender
can i get a loan with bad credit
secure loan
holiday loans
legit payday loans
kwikcash
lend money
payday loans in maryland
take out a loan
goverment loans
small cap funds
payday loans houston

how to get personal loan
payday loans bad credit direct lender
can i get a loan with bad credit
secure loan
holiday loans
legit payday loans
kwikcash
lend money
payday loans in maryland
take out a loan
goverment loans
small cap funds
payday loans houston

loan payday
loan payday
personal loan apply online
tennessee quick cash
fastcash com
secured loans
short loans
think cash
same day loans
las vegas payday loan centers
payday loans
bad credit unsecured loans
ez payday loan

loan payday
loan payday
personal loan apply online
tennessee quick cash
fastcash com
secured loans
short loans
think cash
same day loans
las vegas payday loan centers
payday loans
bad credit unsecured loans
ez payday loan

loan payday
loan payday
personal loan apply online
tennessee quick cash
fastcash com
secured loans
short loans
think cash
same day loans
las vegas payday loan centers
payday loans
bad credit unsecured loans
ez payday loan

loan payday
loan payday
personal loan apply online
tennessee quick cash
fastcash com
secured loans
short loans
think cash
same day loans
las vegas payday loan centers
payday loans
bad credit unsecured loans
ez payday loan

5000 loan bad credit
cash loans fast
direct online payday lenders
easy online payday loans
paydayadvance
advance payday
pay day loan
payday loans direct lender only
poor credit personal loans
payday loans
advance cash
eloans
loans bad credit

5000 loan bad credit
cash loans fast
direct online payday lenders
easy online payday loans
paydayadvance
advance payday
pay day loan
payday loans direct lender only
poor credit personal loans
payday loans
advance cash
eloans
loans bad credit

Pages