Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7936887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:21:06+00:00 2026-06-03T22:21:06+00:00

When I use SSMS to create an assembly dll, it generates a script like

  • 0

When I use SSMS to create an assembly dll, it generates a script like this :

CREATE ASSEMBLY [SqlFunctions]
AUTHORIZATION [dbo]
FROM 0x4D5A9...
WITH PERMISSION_SET = UNSAFE

To generate this script automatically, I must generate the FROM 0x4D5A9... part, is it the hex dump of the dll ?

Is it possible using an SQL function or should I generate this hex dump with a c# function ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:21:07+00:00Added an answer on June 3, 2026 at 10:21 pm

    There’s no SQL function. You can create it using some C# like this:

    Assembly clrAssembly = ...;
    const string createTemplate = @"CREATE ASSEMBLY [{0}] AUTHORIZATION [dbo] FROM 0x{1};";
    
    var bytes = new StringBuilder();
    using (var dll = File.OpenRead(clrAssembly.Location))
    {
    int @byte;
    while ((@byte = dll.ReadByte()) >= 0)
        bytes.AppendFormat("{0:X2}", @byte);
    }
    
    var sql = string.Format(createTemplate, clrAssembly.GetName().Name, bytes);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the generated script from SSMS Script Table as->Create To: USE [DADatabaseMarch11] GO SET
This is from SQL Server 2008, ssms When I create a table, it creates
I'd quite like to use ADO.NET to generate a CREATE TABLE script to create
I'd like to extract data from a .csv file. I cannot use OpenRowSet on
I am using SSMS 2008 and trying to use a HAVING statement. This should
If you run the exec stored procedure command in SSMS, it produces this script:
use this website a lot but first time posting. My program creates a number
Here's my configuration: I have a re-runnable batch script that I use to update
I'm reading an article from this website , but when i run the code
Using SQL Server Management Studio 2005 (SSMS) I can use the import wizard to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.