Skip to content

Tag: sql

Stored procedure returns int instead of result set

I have a stored procedure that contains dynamic select. Something like this: In SSMS the stored procedure runs fine and shows result set. In C# using Entity Framework it shows returning an int instead of IEnumerable? Generated function for usp_GetTestRecords Answer Entity Framework can’t tell what your …

Sum columns depending on another column value

I’m having trouble with summing the fields values based on another fields value. I need to SUM(activities.points) based on activities.activity_type if it’s used_points or added_points and put it in AS used_points/added_points. Table activities: Table subscriptions: What I need: What I tried : Whic…

Test for Upper Case – T-Sql

All, How can I check if a specified varchar character or entire string is upper case in T-Sql? Ideally I’d like to write a function to test if a character is upper case, then I can later apply that to a generic varchar. It should return false for non alphabetic characters. I am only interested in englis…