I have 3 separate SQL Server tables: Compensation, Grant, and Compensation Grant.
What I want is according to the first parameter passed to the web service of type integer(1 for Compensation, 2 for Grant, 3 for Compensation Grant), and the second parameter of type integer that specifies the year/month (for example 201905 for May, 2019), I will select all records from the table specified where the field="201905")
For example:
if TableType="Compensation" then
Select fields(A,B,C) FROM [Compensation] WHERE D=201905
if TableType="Grant" then
Select fields(A,B,C) FROM [Grant] WHERE D=201905
if TableType="Compensation Grant" then
Select fields(A,B,C) FROM [CompensationGrant] WHERE D=201905
So How to write the whole Web Service that returns data for both: JSON and XML?