How to list the version number of an assembly and in which database it exists

  • 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.

  • 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!

  • Thats terrific ... thanks Lowell. I went through many forums and there wasn't anything close to this.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply