Welcome to Port3101.org : Your BES Connection Mark forums read | View Forum Leaders
Port3101.org : Your BES Connection



Rate this Entry

UPDATED: SQL script to count # users per mail server

Submit "UPDATED: SQL script to count # users per mail server" to Digg Submit "UPDATED: SQL script to count # users per mail server" to del.icio.us Submit "UPDATED: SQL script to count # users per mail server" to StumbleUpon Submit "UPDATED: SQL script to count # users per mail server" to Google
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:

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!
Posted in Uncategorized
Views 726 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 12:09 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.


 

Content Relevant URLs by vBSEO 3.3.2 PL2