SqlAssembly.Create is a poor implementation

SqlAssembly.Create will receive a path at the server, that as the documentation states: can be a network share. Now in areal-world scenario, I am creating a database on a separate server using SMO. When I try to register my managed code what am I supposed to do?

Get the user to call an administrator to copy the path into the server?
Somehow, find out the Identity for SQL Server and create a temporary share so that the SQL service can access the assembly?

Why isn't there a function that receives the Binary assembly data and persists the assembly on a Temporary location so that you can upload it into SQL.

[644 byte] By [JuanRoman] at [2008-1-10]
# 1
You can call asm.Create(new string[] { @"filename.dll" });

This overload will cause SMO to serialize your assembly into a varbinary literal and allows you to call this from any client, as the T-SQL sent to the server will contain the entire assembly inline (using 0x.... varbinary notation). You do not need shares. Just access to your local client disk (which may be a diffent server than SQL Server is).

Hope this helps.

MichielWories at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...

SQL Server

Site Classified