Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Detect if data retrieved in View

$
0
0

Lets say I have this View on MyTable:

    CREATE VIEW MyView (IDValue, LastName, FirstName)
        AS SELECT IDValue, LastName, FirstName FROM MyTable;

Is there a way in the View that I can tell that data is being retrieved versus data just being counted? 

E.g., Data retrieved:

    SELECT FirstName FROM MyView;

Data Counted - no column data retrieved:

    SELECT COUNT(*) WHERE FirstName IS NOT NULL;

My research shows that there is not, but I was hoping that someone knew of a technique.

Thanks.



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>