November 29, 2008 at 11:07 pm
Glad we could help.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
November 30, 2008 at 6:06 am
Jeff Moden (11/29/2008)
Heh... not to worry... it's not as bad as that dummy that thought the sum of the differences between two points could be used to determine the closest point., π
Haha Jeff you're so mean! π
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
November 30, 2008 at 7:39 am
Chris Morris (11/30/2008)
Jeff Moden (11/29/2008)
Heh... not to worry... it's not as bad as that dummy that thought the sum of the differences between two points could be used to determine the closest point., πHaha Jeff you're so mean! π
Just to be sure, the "dummy" I was talking about was me! :blush: Forgot to wear my tinfoil hat while I was posting. π
--Jeff Moden
Change is inevitable... Change for the better is not.
December 1, 2008 at 5:40 am
For backward compatibility this works. You declared the column name so you do not need to put it in quotes in the Where.
CREATE PROC spWhichTable( @ColumnName varchar(50) )
AS
SELECT o.name as [Table], c.name as [Column]
FROM sysobjects o
JOIN syscolumns c ON o.id = c.id
WHERE c.name = @ColumnName
AND o.xtype = 'U'
December 1, 2008 at 5:50 am
That was identified and resolved about 6 posts ago.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 1, 2008 at 5:55 am
1. Excuse me for not noticing 2 pages; the second page pointing out the quotes.
2. My post is still valid for those who may need the older syntax of sysobjects/syscolumns rather than the newer sys.tables/sys.columns.
December 1, 2008 at 12:33 pm
Doesn't anyone use the INFORMATION_SCHEMA views anymore?
Todd Fifield
December 1, 2008 at 12:39 pm
Sure, I use them all the time, however, we were just trying to fix the OP's query, with minimal change.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 1, 2008 at 12:55 pm
Barry,
Got it. I normally use the views unless I have to get down and dirty and find out of a column is computed or a timestamp or something like that.
I would think that finding tables that use a specific column name would be easier using INFORMATION_SCHEMA.COLUMNS.
Todd Fifield
January 21, 2010 at 9:58 am
v
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply