Is there a function to show the table name at sql server?
I want to check if the user is found at a specific table, the table's name should be returned, can I do it?
WHERE Std_ID = @UserId)
Since you already know you're going to check the Student table, just return the value 'Student'
if(exists(select * from Student where Std_ID = @UserId)) begin select 'Student' as TableName return; end