Where can we use "EXECUTE…WITH RESULT SETS"?

 Posted by Niladri.Biswas on 5/16/2013 | Category: Sql Server Interview questions | Views: 1112 | Points: 40

a.Data conversion will become simpler in SSIS .

b.Changing the data type without changing the schema. Suppose a dotnet application is expecting a Boolean and the underlying schema was designed as of type int for that column.Ideally we do a conversion at runtime as Case When <condition> Then 1 Else 0. Instead of that, we can directly change the data type to bit.

c.Another example can be say the dotnet application is expecting a int but the column type is float.

d.Another usage may be say the schema has been changed and the DAL layer is not aware of this. May be the same stored procedure is called from multiple places. In such a scenario, we can just change the column names at runtime in the With Result Set so that the table schema as well as the DAL logic will be un touched.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response