Take the following sample code.    Four similar tables with an INT IDENTITY, BIGINT IDENTITY, and two with UNIQUEIDENTIFIERS, one using newid() and the other with newsequentialid(). Once the tables are created and we insert 100,000 rows into each, they are very similar, but they take up very different amounts of disk space. Using the Database Health Reports application, we …

Should I Use A Unique Identifier As A Primary Key? Read more »

Today I had the opportunity to present on TempDB to the Spokane SQL Server users group (PASS Chapter). The session was titled TempDB – Do This and Don’t Do That”, and it covers a bunch of tips and best practices around what to do and avoid relating to TempDB on your SQL Server. Here is the download of the presentation and …

TempDB – Do This and Don’t Do That Read more »

A while back a wrote a blog post with a query to Visualize the VLF’s in your database. Today I have an update to that script. Here is an updated script that has adds another column called “TextStatus” to the output to give you a better idea of what the different statuses mean. You now get 3 statuses shown, “In …

Visualizing VLF’s – Updated Read more »

One of my favorite queries this week is the following query that creates a text based bar chart to quickly help visualize the VLF files on any database log file. In the last month I have given the “TempDB Do This and Don’t Do That” presentation twice, once at the Bellingham SQL Server users group, and another time at SQL …

Visualizing Log File VLF Sizing Read more »

After writing a recent blog post on Are you wasting half the capacity of IDENTITY, I started thinking about how much is too big for an BIGINT IDENTITY. If you don’t know about, you can get Are you wasting half the capacity of IDENTITY 9,223,372,036,854,775,807 IDENTITY values out of a BIGINT in SQL Server.  Which in easier terminology is 9 with roughly 18 …

How BIG is too BIG for a BIGINT IDENTITY? Read more »

When creating a table you can specify IDENTITY with the following syntax: For example The IDENTITY property is valid for data types of the integer data type category, except for the bit data type, or decimal data type.  So how many rows can you insert into that table?  It depends on the data type used. BIGINT maximum value is 9,223,372,036,854,775,807 …

Are you wasting half the capacity of IDENTITY? Read more »

Take the following sample code.    Four similar tables with an INT IDENTITY, BIGINT IDENTITY, and two with UNIQUEIDENTIFIERS, one using newid() and the other with newsequentialid(). Once the tables are created and we insert 100,000 rows into each, they are very similar, but they take up very different amounts of disk space. Using the Database Health Reports application, we …

Should I Use A Unique Identifier As A Primary Key? Read more »

The quick and easy way to determine how much memory your SQL Server is using is to look at the Task Manager on the server and find “sqlservr.exe” in the process list, and look at the “Mem Usage” column. But what if you are not on the server, or if you want to grab this information programmatically from an application, …

Query SQL Server 2008 Total Memory Usage Read more »