Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » T-SQL

Using Perfmon with SQL Server – Part Two

Yesterday I posted a header from a script that shows you some links for how to use “Logman”, a Windows command-line utility that can automate your collection of Windows Performance Monitor counters. Towards the bottom, you can see the logman command I

Color Me Corrected – Will the REAL sysobjects please stand up?

A few days ago I posted a way to look at the Dynamic Management Views (DMV’s) using a query, which I then copy and paste into the Help viewer’s Index tab to learn more. Well, my good friend and Colleague, Cliff, pointed out that I was using the older

T-SQL Prettifiers

OK, I don't think that's even a word, but the synonyms (can a non-word have a synonym?) are code beautifiers, sql formatters, etc. The basic idea is that it's a program that re-formats the text in a Transact-SQL statement using a standard set of rules.

Commenting your Code

You should always add descriptive comments to any code that will live longer than a single event. It's useful not only for the other unfortunate souls blessed with your code, but for yourself, years later, when you say "what was I thinking here?"

A Template for Setting and Reading Extended Properties

In the SQLCMS project, I show an example of some "base tables" that you can create for the system. Whenever I create a database, or database object, I make use of a feature that's been around for quite awhile - Extended Properties. You can set and read

T-SQL to Find Physical and Logical Processors

I ran into a licensing question the other day on Physical versus Logical Processors. Happily, Microsoft only charges you for Physical sockets - which you can find with this query: SELECT cpu_count / hyperthread_ratio AS PhysicalCPUs FROM sys.dm_os_sys_info

Listing the Central Management Servers Programmatically

I don't normally advocate hitting the system tables in any database with direct queries, preferring instead to use views or functions that the vendor provides. But so far I haven't been able to find the view or function that would return the list of servers

Back to basics - Using another Default Filegroup

SQL Server uses the file system on a computer, just like all database platforms. Whenever you create a database, there are always at least two files that are created - one for the data (MDF files) and another for the logging function (LDF files). But

Using WITH MIRROR to Copy Your Backups

The other day I chatted with a gentleman who needed a second copy of his backup for a remote reporting system. Most of us need a copy or two of the backups, sometimes for a reporting or development refresh, or sometimes we want a second copy for safety

Scripts, Blogs, and Learning

I received an e-mail from a reader asking if I could post a link to a script he's documented in an article. I'm always happy to do that, but there are some things you should know about ANY script you find on the web, and while I'm at it, for how you read
Posted by Buck Woody | 4 Comments
Filed under: , , ,

Versioning the Database

If you write apps that hit a database that you own, then you probably want version control on the database itself. I always script out the initial database, and version that script. I also script the changes, and version those, and then script the entire

Free T-SQL Beautifier

I do love me some good-looking code. Sure, the syntax has to be there, and the code has to be correct and all that, but I'm old-school, and I think pretty code is easier to read. I'd love to have a "code beautifier" built right in to SQL Server

Top Queries DMV

I spoke at the Pacific Northwest SQL Server User Group last night, and we covered Performance tuning. I promised to blog a script that uses the "query_stats" DMV and a CROSS APPLY to find the top queries - there are lots of these on the web, so here's

Mandelbrots and SQL Server

I was watching Nova last night and they talked to Benoit Mandelbrot, the man who codified some of the math that bears his name. This math branch deals with "rough" or repeating surfaces. You probably already know that Transact-SQL can be used
Posted by Buck Woody | 2 Comments
Filed under: ,

Getting Bit by Forgetting

I was working on a SQL Server 2005 system yesterday and I had really awful performance on one of my queries. I just couldn't figure out why it was running slow. I decided to use the new SQL Server 2008 T-SQL Debugger on the code, and sure enough - I found
Posted by Buck Woody | 2 Comments
Filed under: , ,
More Posts Next page »
 
Page view tracker