Avatar of mcrmg
mcrmg
 asked on

SQL display column name with condition

Hi,

I know sql can display column name of a table by using this

select Column_name
from Information_schema.columns
where Table_name like 'myTable'

There are over 200 fields in this table, but I do not want to display all the fields to the users. What would be the best way to do this?  thanks
Microsoft SQL ServerSQL

Avatar of undefined
Last Comment
mcrmg

8/22/2022 - Mon
Pawan Kumar

provide column names.

select [col_1],[col_2]...................etc 
from Information_schema.columns 
where Table_name like 'myTable'

Open in new window

ASKER CERTIFIED SOLUTION
Scott Pletcher

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mcrmg

ASKER
thank you
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy