February 29, 2012 at 9:57 am
Hello Everyone
I found something today, that I do not ever remember seeing in the past.
I found a table name with the word '(obsolete)' directly next to it. I have no idea where or how this database table was created. From the column data types, looks like Excel or Access.
Here is a sample of what I see:
dbo.tbl_ec_cpoassignments(obsolete)
Not only do I really hate the prefix 'tbl_', the data in the table does not come close to matching the name of the table.
Has anyone ever seen this before? Anyone know what this means? I cannot find anything in the SQL BOL, or online search.
Thanks
Andrew SQLDBA
February 29, 2012 at 10:03 am
AndrewSQLDBA (2/29/2012)
Hello EveryoneI found something today, that I do not ever remember seeing in the past.
I found a table name with the word '(obsolete)' directly next to it. I have no idea where or how this database table was created. From the column data types, looks like Excel or Access.
Here is a sample of what I see:
dbo.tbl_ec_cpoassignments(obsolete)
Not only do I really hate the prefix 'tbl_', the data in the table does not come close to matching the name of the table.
Has anyone ever seen this before? Anyone know what this means? I cannot find anything in the SQL BOL, or online search.
Thanks
Andrew SQLDBA
Curious, do you need to include the (obsolete) when you query the table?
February 29, 2012 at 10:06 am
My guess is that is the table name. Some dev trying to indicate that this table is obsolete. Not the greatest way to have built it but there is nothing syntactically wrong with it. You will have to wrap the table name in [] because the parser will get confused with the parenthesis.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 29, 2012 at 10:36 am
I should have stated this in the first post. But never really thought about it until you guys mentioned it.
SQL Server will not let me query the table, with the funky name. The object does appear in the sysobjects table. The only way that I can query from that table is to rename it to something normal.
Thanks everyone
Andrew SQLDBA
February 29, 2012 at 10:41 am
You have to wrap the name with []
select * from dbo.[tbl_ec_cpoassignments(obsolete)]
Here is a create, select and drop as an example
create table [funkyName(obsolete)]
(
Seriously varchar(10)
)
go
select * from dbo.[funkyName(obsolete)]
go
drop table [funkyName(obsolete)]
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply