September 2009
S M T W T F S
« Jun   Oct »
 12345
6789101112
13141516171819
20212223242526
27282930  

SQL University – Students, Head Over to Orientation Please!

My good Twitterfriend Jorge Segarra, a.k.a. SQLChicken (Blog | Twitter) came up with a great idea that will hopefully be an awesome learning resource for those wanting to learn SQL Server from scratch, or refresh knowledge on certain topics within the SQL Server realm. It’s the SQL University. Orientation is located here. I am happy [...]

Server-level Trigger to Notify on SQL Login Changes (Including Password Changes)

Ideally, you want to go with Windows Authentication for all your users in SQL Server whenever possible. In the real world, most applications rely on SQL logins. So it happens rather frequently that when the password for a SQL login that is critical to an application is changed, that application breaks. Now, granted, if you are doing things [...]

SQL Service Accounts and SPNs (Service Named Principals)

Ah, the nuisances of AD and Kerberos. Whenever you change the service account on a SQL instance, you need to make sure that an SPN pointing to the SQL instance is in place for the Service Account. Otherwise, you might get the dreaded “cannot generate sspi context” error. To manage SPNs registered on your service [...]

Find out which tables have a Primary Key

If you want to do transactional replication, all the tables in the publication need to have a primary key. Here’s a quick way to determine which tables have a primary key.

This is the query for SQL 2005 and 2008:

SELECT so.name AS TableName, OBJECTPROPERTY(so.object_id, ‘TableHasPrimaryKey’) AS HasPrimaryKey
FROM sys.objects so
WHERE type = ‘U’

And here is the query [...]