To check if a column exists in MSSQL you can use the following snippet.
Sample MSSQL
SELECT name FROM sys.columns WHERE object_id = OBJECT_ID('Pricetable') AND name='Price'
To check if a column exists in MSSQL you can use the following snippet.
SELECT name FROM sys.columns WHERE object_id = OBJECT_ID('Pricetable') AND name='Price'
To list all columns from a table in MSSQL you can use the following snippet.
SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('TABLENAME') ORDER BY name ASC
If you are using Oracle, take a look at this snippet -> How to get all column names of a Table in Oracle