Monday 15 July 2013

sql - how can i grab the alias of every field with "select *"? -


How do I list all the field names in my query: < Pre> table1.field1, table1.field2, table1.field3, table2.field1, table2.field2 etc

with this selection statement:

  Choose from Status Inner * Join r.RES_ID = s.RES_ID on residents rr.MainPeopleIDY = r.RES_PeopleIDY Inner REPSResidents rr Join residents at s.STA_User = u.USR_ID Join Inner Associate U Join KSLSQL1 . [RPS-20065-000] .dbo.people at p r.RES_PeopleIDY = p.PeopleIDY where .......   

My problem is that in SSRS, I Select not just what can do * because there are several fields from several tables that repeat.

So I'll need a list of all those areas that are returned

Is this possible?

  select t.name + '_' + c from the internal sys.columns c.name Join sys.tables c on c.object_id = t.object_id wherea t.name = a 'residents'    

No comments:

Post a Comment