Mark Minasi's Reader Forum
Mark Minasi's Reader Forum
Home | Profile | Register | Active Topics | Active Polls | Members | Search | FAQ | Minasi Forum RSS Feed
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Email, Databases, Sharepoint and more
 SQL Server
 Invalid object name 'information_schema.columns'.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Curt
Moderator

USA
6652 Posts
Status: offline

Posted - 06/08/2012 :  2:52:44 PM  Show Profile  Visit Curt's Homepage  Reply with Quote
select column_name,* from information_schema.columns
where table_name = 'YourTableName'
order by ordinal_position

This worked fine in my SQL 2008 instance but I got an invalid object name using it on some SQL 2005 boxes.

The fix is to put it in caps.
select column_name,* from INFORMATION_SCHEMA.COLUMNS
where table_name = 'SOP30300'
order by ordinal_position

Very useful since it returns the table fields and a good deal of information regarding them.
SOPTYPE DEV dbo SOP30200 SOPTYPE 1 smallint
SOPNUMBE DEV dbo SOP30200 SOPNUMBE 2 char
ORIGTYPE DEV dbo SOP30200 ORIGTYPE 3 smallint
ORIGNUMB DEV dbo SOP30200 ORIGNUMB 4 char
DOCID DEV dbo SOP30200 DOCID 5 char
DOCDATE DEV dbo SOP30200 DOCDATE 6 datetime
GLPOSTDT DEV dbo SOP30200 GLPOSTDT 7 datetime
QUOTEDAT DEV dbo SOP30200 QUOTEDAT 8 datetime
QUOEXPDA DEV dbo SOP30200 QUOEXPDA 9 datetime
ORDRDATE DEV dbo SOP30200 ORDRDATE 10 datetime
INVODATE DEV dbo SOP30200 INVODATE 11 datetime
BACKDATE DEV dbo SOP30200 BACKDATE 12 datetime
RETUDATE DEV dbo SOP30200 RETUDATE 13 datetime
ReqShipDate DEV dbo SOP30200 ReqShipDate 14 datetime

Curt Spanburgh
Microsoft Certified Business Solution Specialist.
Dynamics CRM MVP
Contributing Editor, Windows IT Pro

He that is walking with wise persons will become wise, but he that is having dealings with the stupid ones will fare badly.
Proverbs 13:20


  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Mark Minasi's Reader Forum © 2002-2011 Mark Minasi Go To Top Of Page
This page was generated in 0.09 seconds. Snitz Forums 2000