Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Registers the name of a new extended stored procedure to SQL Server.
Note
This feature will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use Common language runtime (CLR) integration instead.
Transact-SQL syntax conventions
sp_addextendedproc
[ @functname = ] N'functname'
, [ @dllname = ] 'dllname'
[ ; ]
The name of the function to call within the dynamic-link library (DLL). @functname is nvarchar(517), with no default. @functname optionally can include the owner name in the form <owner.function>
.
The name of the DLL that contains the function. @dllname is varchar(255), with no default. You should specify the complete path of the DLL.
0
(success) or 1
(failure).
None.
After an extended stored procedure is created, it must be added to SQL Server by using sp_addextendedproc
. For more information, see Adding an Extended Stored Procedure to SQL Server.
This procedure can be run only in the master
database. To execute an extended stored procedure from a database other than master
, qualify the name of the extended stored procedure with master
.
sp_addextendedproc
adds entries to the sys.objects catalog view, registering the name of the new extended stored procedure with SQL Server. It also adds an entry in the sys.extended_procedures catalog view.
Important
Existing DLLs that aren't registered with a complete path don't work after upgrading to SQL Server. To correct the problem, use sp_dropextendedproc
to unregister the DLL, and then reregister it with sp_addextendedproc
, specifying the complete path.
Only members of the sysadmin fixed server role can execute sp_addextendedproc
.
The following example adds the xp_hello
extended stored procedure.
USE master;
GO
EXEC sp_addextendedproc xp_hello, 'c:\xp_hello.dll';
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today