UPDATED: SQL script to count # users per mail server
Posted 06-12-2009 at 10:07 AM by hdawg
Updated 07-28-2009 at 10:34 PM by hdawg (Added a simpler script)
Updated 07-28-2009 at 10:34 PM by hdawg (Added a simpler script)
UPDATED:
Since creating the script below, I've put together a simpler one that works the same:
SELECT CAST(ServerDN AS VARCHAR(256)) , COUNT (*)
FROM UserConfig
GROUP BY CAST(ServerDN AS VARCHAR(256))
----------
RadHaz75 @ port3101.org posted a request for a SQL script to count the number of BES users per mail server in his BlackBerry Configuration Database.
I've posted the script in the thread, but here it is too:
DECLARE @ZZZtemp TABLE (
UserName VARCHAR( 256 ),
ServerName VARCHAR( 256 ))
INSERT INTO @ZZZtemp (UserName, ServerName)
SELECT DisplayName, ServerDN
FROM UserConfig
SELECT ServerName, (COUNT (*)) AS NumUsers FROM @ZZZTemp Z GROUP BY Z.ServerName
I would normally just use the final SELECT statement to gather the data, but it isn't possible given the data types in the UserConfig table.
If you or anyone has a request for script, post it Scripts & Tools / Hints & Tricks - Port3101.org : Your BES Connection and someone will help!
Since creating the script below, I've put together a simpler one that works the same:
SELECT CAST(ServerDN AS VARCHAR(256)) , COUNT (*)
FROM UserConfig
GROUP BY CAST(ServerDN AS VARCHAR(256))
----------
RadHaz75 @ port3101.org posted a request for a SQL script to count the number of BES users per mail server in his BlackBerry Configuration Database.
I've posted the script in the thread, but here it is too:
DECLARE @ZZZtemp TABLE (
UserName VARCHAR( 256 ),
ServerName VARCHAR( 256 ))
INSERT INTO @ZZZtemp (UserName, ServerName)
SELECT DisplayName, ServerDN
FROM UserConfig
SELECT ServerName, (COUNT (*)) AS NumUsers FROM @ZZZTemp Z GROUP BY Z.ServerName
I would normally just use the final SELECT statement to gather the data, but it isn't possible given the data types in the UserConfig table.
If you or anyone has a request for script, post it Scripts & Tools / Hints & Tricks - Port3101.org : Your BES Connection and someone will help!
Total Comments 0











