Posts
57
Comments
95
Trackbacks
27
September 2006 Entries
Objects Search in SQLServer 2005 - part 2

Last week I wrote about how to search for tables and columns in SQLServer2005, since they removed the Objects Search.  After I posted it, I realized that it didn't link the columns to the tables, which doesn't make it very helpful.  Thanks to my DBA buddy James Rogers for pointing me in the right direction, here's a more helpful query.  You can leave either COLName or TBLName blank by commenting out the set command.

 

DECLARE @COLName NVARCHAR(50), @TBLName NVARCHAR(50)

SET @COLName = 'bu_id%'
SET @TBLName = 'f_gen%'

Select TABLE_CATALOG,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME
From    Information_Schema.Columns
Where COLUMN_NAME LIKE coalesce(@COLName, '%')
and      TABLE_NAME like coalesce(@TBLName, '%')

 

Since we are on the subject of SQLServer 2005, I thought this worthy of mentioning.  Today was the last day in my office for a colleague of mine, Charlie Carson.  Charlie is one of those profound minds that I go went to when I'm was totally stumped.  My understanding is that Charlie will soon be at Microsoft working on developer tools for SQLServer 2005.  As much as I will miss having Charlie around, I am more excited about the future value he will add to SQLServer.  Congratulations Microsoft.  You did good recruiting this one. 

Cheers,

John

http://workdog.org

posted @ Tuesday, September 19, 2006 8:31 PM | Feedback (0)
Objects Search in SQLServer 2005 - work around

The other day someone saw me hit F4 and bring up the Object search in a SQLServer 2000 Query Analyzer.  They only had SQLServer 2005 installed and wanted to know how to use it there.  After some research, I realized that it no longer exists.  I'm not sure why they took this away.  I found it quite useful, although I 'fat fingered' the f4 key more times than I hit it on purpose. 

Although the UI made it easy, this information is still available in SQLServer 2005 through these two tables: sysobjects and syscolumns.  Here's a query that may help.

SELECT name,
CASE xtype
  WHEN 'C' THEN 'CHECK constraint'
  WHEN 'D' THEN 'Default or DEFAULT constraint'
  WHEN 'F' THEN 'FOREIGN KEY constraint'
  WHEN 'L' THEN 'Log'
  WHEN 'FN' THEN 'Scalar function'
  WHEN 'IF' THEN 'Inlined table-function'
  WHEN 'P' THEN 'Stored procedure'
  WHEN 'PK' THEN 'PRIMARY KEY constraint (type is K)'
  WHEN 'RF' THEN 'Replication filter stored procedure'
  WHEN 'S' THEN 'System table'
  WHEN 'TF' THEN 'Table function'
  WHEN 'TR' THEN 'Trigger'
  WHEN 'U' THEN 'User table'
  WHEN 'UQ' THEN 'UNIQUE constraint (type is K)'
  WHEN 'V' THEN 'View'
  WHEN 'X' THEN 'Extended stored procedure'
END as type
FROM sysobjects WHERE name LIKE '%bu_id%'
UNION ALL
SELECT name, 'column' FROM syscolumns  WHERE name LIKE '%bu_id%'

posted @ Thursday, September 14, 2006 7:14 PM | Feedback (1)
Splitting tabs in Visual Studio

I wrote a short time ago about the use of Visual Studio for xslt development.  One of the things that I failed to mention was that I didn't like how I had to flip back and forth between my xslt and my xml files.  Well, thanks to Chris Breish's blog entry today, that problem has gone away.  He mentioned that docking tabs was available in Visual Studio.  This got me started, and I was able to figure it out quickly.  I have since shown it to three other folks who didn't know about it, so I'm sure there are other that could benefit.  Thanks Chris!  And thanks to the developer at MS that put this in. 

It's so simple!  Just right click on one of your tabs and click "New Vertical Tab Group".  Horizontal is also available.  To move it back, just click on one of the tabs and drag it back into the original tab group.  It can't get any easier that this. 

Also, in case you missed the comments from DrewG, Snippets are available in Visual Studio, I was just unaware of them.  I tried them the other day.  They are as intuitive as I would like them to be.  I think once I set them all up, it will be worth the effort.

Cheers,
John

posted @ Friday, September 01, 2006 1:21 PM | Feedback (2)
News
Xobni outlook add-in for your inbox