SQL Queries

This folder holds helpful queries.

In ALM, find the last logon date of a user
Applies To:  ALM 11.5, SQL Database Issue:  Find the last logon date of a user.  This will be helpful when trying to archive old, ...
Sat, 23 Apr, 2016 at 7:56 PM
Assign TD user to TD - Upgrade Query
Applies To:  HP Quality Center or ALM upgrade.   Issue:  Anytime a database is copied to another database server, the TD user needs to be m...
Sat, 23 Apr, 2016 at 7:56 PM
Find Size of Databases on SQL Server
Applies To:  SQL Server Issue:  Find the size of all databases on the SQL Database server Resolution:  Execute this query in SQL ma...
Sat, 23 Apr, 2016 at 7:57 PM
Queries users who have not logged in for a certain time
Applies To:  HP ALM/QC 11.52, Oracle Database  Issue:  The user wants to report on old users.  Old users who they could potentially delete or ...
Sat, 23 Apr, 2016 at 7:59 PM
Query Projects that have not been logged into for a certain time
Applies To:  HP ALM/QC 11.52, Oracle Database  Issue:  The user wants to report on old projects and archive projects that have not been logged...
Sat, 23 Apr, 2016 at 8:00 PM
HP ALM DB Upgrade Query
If you're migrating MSFT SQL Servers that host your ALM DB be sure to execute the queries below:   EXEC sp_change_users_login 'Report'...
Sat, 23 Apr, 2016 at 8:02 PM
HP ALM - Orphan Run Query
If you wish to find all of the orphaned run entities for a project then you can run the following query: SELECT rn_test_id FROM <PROJECT>.run ...
Sat, 23 Apr, 2016 at 8:03 PM
SQL Server Product Version and Patch Level Query
If you are in need of determining the version and patch level of a SQL Server DB you can run the following command: SELECT SERVERPROPERTY('prod...
Sat, 23 Apr, 2016 at 8:04 PM
Create a table of summed step statuses
This query will create a table that sums all the statuses of a specific run.  I used this to tally up step statuses and in an effort to record some sort of ...
Sat, 23 Apr, 2016 at 8:04 PM
Query all projects and report the last time they have been logged into
Applies To:  HP ALM Issue:  The customer would like to see how many projects they have, and the last time the projects were logged into. Th...
Fri, 29 Apr, 2016 at 11:16 AM