/*===================================================================== File: InstallVB.sql Summary: Registers the VB assembly, function, and procedures into SQL Server for the InProcessDataAccess sample. Date: June 14, 2004 --------------------------------------------------------------------- This file is part of the Microsoft SQL Server Code Samples. Copyright (C) Microsoft Corporation. All rights reserved. This source code is intended only as a supplement to Microsoft Development Tools and/or on-line documentation. See these other materials for detailed information regarding Microsoft code samples. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. ======================================================= */ USE AdventureWorks; GO /** * The following statement assumes that sqlserver and the samples are installed in the default location. * If you have the samples installed in a different location, please edit this path to point to your * location. */ DECLARE @SamplesPath nvarchar(1024) -- You may need to modify the value of the this variable if you have installed the sample someplace other than the default location. SELECT @SamplesPath = replace(physical_name, 'Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf', 'Microsoft SQL Server\90\Samples\Engine\Programmability\CLR\') FROM master.sys.database_files WHERE name = 'master'; CREATE ASSEMBLY InProcDA FROM @SamplesPath + 'InProcessDataAccess\VB\InProcessDataAccess\bin\InProcDA.dll' WITH permission_set = SAFE; GO CREATE PROCEDURE [SendMessage] @msg nvarchar(4000) AS EXTERNAL NAME [InProcDA].[Microsoft.Samples.SqlServer.DataAccessDemo].[SendMessage]; GO CREATE FUNCTION [ReportSqlVersion]() RETURNS nvarchar(4000) AS EXTERNAL NAME [InProcDA].[Microsoft.Samples.SqlServer.DataAccessDemo].[ReportSqlVersion]; GO CREATE PROCEDURE [SendTransientResultSet] AS EXTERNAL NAME [InProcDA].[Microsoft.Samples.SqlServer.DataAccessDemo].[SendTransientResultSet]; GO CREATE PROCEDURE [ExecuteToClient] AS EXTERNAL NAME [InProcDA].[Microsoft.Samples.SqlServer.DataAccessDemo].[ExecuteToClient]; GO CREATE PROCEDURE [SendReaderToClient] AS EXTERNAL NAME [InProcDA].[Microsoft.Samples.SqlServer.DataAccessDemo].[SendReaderToClient]; GO /* DROP PROCEDURE [SendMessage] DROP FUNCTION [ReportSqlVersion] DROP PROCEDURE [SendTransientResultSet] DROP PROCEDURE [ExecuteToClient] DROP PROCEDURE [SendReaderToClient] DROP PROCEDURE [ExecutePredefinedQuery] DROP ASSEMBLY InProcDA */