Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Creating an ASSEMBLY Takes Awhile

Author  Topic 

jeff00seattle
Starting Member

5 Posts

Posted - 2008-11-17 : 11:45:43
Hi

When using CREATE ASSEMBLY within a Dynamic SQL statement, it takes awhile, approximately 15 to 30 seconds.

Why? Can that speed be improved?

Here is the code:

PRINT 'Creating ASSEMBLY Remoting...';

SET @SQL_STMT = N'CREATE ASSEMBLY Remoting FROM '''
+ @InstallLocation + N'\'
+ N'v2.0.50727\System.Runtime.Remoting.dll'' WITH PERMISSION_SET = UNSAFE';

IF EXISTS (SELECT 1
FROM [sys].[assemblies] AS asmbl
WHERE asmbl.[name] = 'Remoting')
BEGIN
DROP ASSEMBLY Remoting;
END

IF NOT EXISTS (SELECT 1
FROM [sys].[assemblies] AS asmbl
WHERE asmbl.[name] = 'Remoting')
BEGIN
EXECUTE dbo.sp_executesql @SQL_STMT;
END


Thanks

Jeff in Seattle
   

- Advertisement -