Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

MS SQL – Count Users In User Role

Posted on October 10, 2016 By David Kittell
SELECT UR.[Id]
,UR.[Name]
,COUNT(ur.name)
FROM [dbo].[UserRole] UR
INNER JOIN dbo.[User] U ON U.Role = UR.Id 
GROUP BY UR.Id, ur.Name
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code MSSQL MSSQL - Audit SQL

Post navigation

Previous post
Next post

Related Posts

Update Table With Inner Join

Posted on September 18, 2013October 26, 2015

UPDATE table1 SET table1.column1 = table2.column1 ,table1.last_name = table2.last_name ,table1.first_name = table2.first_name ,table1.gender = table2.gender FROM table1 INNER JOIN table2 ON table1.child_column2 = table2.column2 WHERE table1.child_column2 IS NOT NULL; Originally Posted on September 18, 2013Last Updated on October 26, 2015 All information on this site is shared with the intention…

Read More

PHP CLI – Restrict to CLI Only

Posted on October 27, 2015

Sometimes it’s easier to run a PHP script than to run a UNIX bash/shell script, this code below will require the use of PHP CLI and prevent it from running in a web browser. Typically a good idea to place the PHP file out of the web directory as well….

Read More

Acrylic Proxy DNS Setup

Posted on October 16, 2015October 16, 2015

While still configuring my changes to Raspberry Pi Setup Proxy Server this works on an individual computer. NOTE: I have this setup mainly for the Wi-Fi, if you want it for wired connections you will need to change Wi-Fi to “Ethernet” or “Ethernet 2” Step 1: Download and Setup Acrylic…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes