Hello Arnab,
- Where are you running the query (SQL Management Studio?)?
- Where did that list of columns come from? (It's not the SQL db names, which is probably where you're getting stuck.)
- What bit did you get stuck on? The query you tried and the result are always useful.
Here is a query that works:
SELECT ref_num, category, priority <<Keep adding in the list here>>
FROM mdb.dbo.call_req
WHERE call_req.type = 'I'
You need to build out the SELECT list.
Notice that your original list of names is using a mapped name, and not the SQL names. For example, you have "Area" meaning "Incident Area", whereas the SQL column is "category."
If you know the source of that original list, then you can work backwards to see what fields it is calling.
(Or use the DocOps documentation to get the field names. Or use "bop_sinfo" against the cr object.)
But a simpler "good enough" approach is just to right click in SQL against the "call_req" table name and accept the default "SELECT Top 1000 Rows" option.
This will generate a query with all of the column names, and then you can use that as your base.
With a bit of guesswork, you should be able to map your original list to the SQL names pretty quickly.
Here is the result:
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [id]
,[persid]
,[ref_num]
,[summary]
,[description]
,[status]
.
.
.
,[actual_comp_date]
,[current_wrkshft]
FROM [mdb].[dbo].[call_req]
Hope that helps.
Thanks, Kyle_R.