Calculating the number of SQL Server processors with Transact

Source: Internet
Author: User
Server

q : How do I use Transact-SQL to programmatically determine how many processors are in my SQL Server computer?

answer : The following statement returns the information you need:

EXEC Master.. xp_msver N ' ProcessorCount ',
N ' ProcessorType '

But I'm passionate about teaching people how to fish, rather than giving them a set of frozen fish bars, so I'm not content with simple answers. A colleague recently asked me this question and I can't think of a proper command, but I know that SQL Server Enterprise Manager displays the number of processors in the Processor tab of the SQL Server Properties dialog box. And, by running simple Transact-SQL statements on the server, enterprise managers can get almost all the information they need. In addition, running SQL Profiler can quickly see the statements generated by Enterprise Manager.

I often count the benefits of using SQL Profiler and observing SQL Server running, and here is another example of implementing this recommendation. With SQL Profiler, I only spent three minutes separating the calls from Enterprise Manager for xp_msver extended stored procedures. At this point, I always think of SQL Profiler first.

Turn from: Dynamic Network production guide www.knowsky.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.