Category Archives: T-SQL
-
CTEs beyond SELECT
5November 20, 2012 by Kenneth Fisher
The other day I was writing a query to pull some DMV information and I ended up using several CTEs …
Continue reading -
Time Trial sys.dm_exec_query_plan vs sys.dm_exec_sql_text
4November 12, 2012 by Kenneth Fisher
I’ve been working on a way to test performance usage on a server by database. I started out using sys.dm_exec_query_stats …
Continue reading -
How do I find all stored procedures or views that use a specific table?
3October 26, 2012 by Kenneth Fisher
Many years ago when I was still working on SQL 2000 I occasionally needed to find all stored procedures and views …
Continue reading -
fn_OBJECT_TYPE
4October 19, 2012 by Kenneth Fisher
I recently started using OBJECT_NAME, OBJECT_SCHEMA_NAME and OBJECT_ID functions; unfortunately I really could have used OBJECT_TYPE but it doesn’t exist …
Continue reading -
Multiple CTEs
10October 9, 2012 by Kenneth Fisher
Multiple CTEs It’s somewhat obscure in BOL and I wasn’t able to find any examples but it turns out you …
Continue reading -
Using a TVP instead of Dynamic SQL to pass a list into a SP
3September 25, 2012 by Kenneth Fisher
A couple of days ago I read Steve Jones’ blog on creating a user defined table type. This reminded me …
Continue reading -
EXECUTE AS USER = ‘Somebody else’
2September 9, 2012 by Kenneth Fisher
As a database administrator I get lots of security requests. “Please grant me read authority on this table, write on that table, …
Continue reading -
sp_helptext
6September 2, 2012 by Kenneth Fisher
My manager has been quietly laughing under his breath at me for years. Usually because I much prefer queries and …
Continue reading





