Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to list the version number of an assembly and in which database it exists Expand / Collapse
Author
Message
Posted Wednesday, June 06, 2012 12:35 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 24, 2012 12:28 PM
Points: 4, Visits: 22
Folks,
Is it possible to programmatically (using T-SQL) to list all the assemblies on my server (different db's) with the associated version numbers ? The idea is to make sure all the assemblies are at the same version in our system. Currently I can double-click each assembly and get the version number , but it is somewhat tedious.
Post #1312115
Posted Wednesday, June 06, 2012 12:58 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 6:24 AM
Points: 12,744, Visits: 31,069
you could query sys.assemblies;
i'm sticking the results in a global temp table for ease of reporting, for example:

CREATE TABLE [dbo].[##RESULTS] (
[DBNAME] NVARCHAR(128) NULL,
[ASSEMBLYNAME] SYSNAME NOT NULL,
[ASSEMBLYVERSION] NVARCHAR(4000) NULL)

EXECUTE sp_msForEachdb 'INSERT INTO ##RESULTS select ''?'' As dbName,name As AssemblyName,clr_name as AssemblyVersion from [?].sys.assemblies '
SELECT * FROM [##RESULTS]
ORDER BY [ASSEMBLYNAME],[ASSEMBLYVERSION],[DBNAME]





Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1312132
Posted Friday, June 08, 2012 7:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 24, 2012 12:28 PM
Points: 4, Visits: 22
Thats terrific ... thanks Lowell. I went through many forums and there wasn't anything close to this.
Post #1313108
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse