Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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 6, 2012 12:35 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 16, 2015 12:19 PM
Points: 4, Visits: 31
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 6, 2012 12:58 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 6:13 PM
Points: 14,312, Visits: 37,384
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

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1312132
Posted Friday, June 8, 2012 7:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 16, 2015 12:19 PM
Points: 4, Visits: 31
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