1 Replies - 837 Views - Last Post: 17 July 2012 - 01:11 AM

#1 Damage  Icon User is offline

  • Lord of Schwing
  • member icon

Reputation: 28
  • View blog
  • Posts: 1,090
  • Joined: 05-June 08

Retrieving table name in mssql

Posted 16 July 2012 - 08:53 PM

Hi

Is there a way to get a tables name from the table itself?
What i'm trying to do is create a join from information_schema to a table using the name, soo kinda like

 SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns 
 inner join dbo.comp A on A.[b]table_name[/b] = INFORMATION_SCHEMA.Columns.table_name
  where TABLE_NAME = 'comp' 



the above doesn't work obviously but thats the idea
Is This A Good Question/Topic? 0
  • +

Replies To: Retrieving table name in mssql

#2 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Retrieving table name in mssql

Posted 17 July 2012 - 01:11 AM

i am not able to understand what you are try to do, can you please elaborate your problem
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1