Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit dd7a9bf

Browse files
authored
Merge pull request #31766 from MicrosoftDocs/FromPublicRepo
Confirm merge from FromPublicRepo to main to sync with https://github.com/MicrosoftDocs/sql-docs (branch live)
2 parents 36e9a5a + 2d8a113 commit dd7a9bf

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

docs/language-extensions/how-to/call-c-sharp-from-sql.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ monikerRange: ">=sql-server-ver15 || >=sql-server-linux-ver15"
1414

1515
[!INCLUDE [sqlserver2019-and-later](../../includes/applies-to-version/sqlserver2019-and-later.md)]
1616

17-
The [SQL Server Language Extensions](../language-extensions-overview.md) feature uses the [sp_execute_external_script](../../relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql.md) system stored procedure as the interface to call the Java runtime.
17+
The [SQL Server Language Extensions](../language-extensions-overview.md) feature uses the [sp_execute_external_script](../../relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql.md) system stored procedure as the interface to call the .NET runtime.
1818

1919
This how-to article explains implementation details for C# code that executes on SQL Server.
2020

@@ -42,15 +42,16 @@ The following are some basic principles when executing C# on SQL Server.
4242
The [sp_execute_external_script](../../relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql.md) system stored procedure is the interface used to call the .NET runtime. The following example shows an `sp_execute_external_script` using the .NET extension, and parameters for specifying path, script, and your custom code.
4343

4444
> [!NOTE]
45-
> You don't need to define which method to call. By default, a method called `execute` is called. This means that you need to follow the [Microsoft Extensibility SDK for C# for SQL Server](extensibility-sdk-c-sharp-sql-server.md) and implement an execute method in your C# class.
45+
> You don't need to define which method to call. By default, a method called `Execute` is called. This means that you need to follow the [Microsoft Extensibility SDK for C# for SQL Server](extensibility-sdk-c-sharp-sql-server.md) and implement an `Execute` method in your C# class.
4646
4747
```sql
4848
DECLARE @param1 INT;
4949

5050
SET @param1 = 3;
5151

52-
EXEC sp_execute_external_script @language = N'dotnet',
53-
@script = N'<packageName>.<ClassName>',
52+
EXEC sp_execute_external_script
53+
@language = N'dotnet',
54+
@script = N'<PackageName>.<ClassName>',
5455
@input_data_1 = N'<Input Query>',
5556
@param1 = @param1;
5657
```
@@ -70,12 +71,12 @@ GO
7071

7172
When it creates an external library, SQL Server automatically has access to the C# classes, and you don't need to set any special permissions to the path.
7273

73-
The following code is an example of calling a method in a class from a package, uploaded as an external library:
74+
The following code is an example of calling the `Execute` method in class `MyClass` from a package `MyPackage`, uploaded as an external library:
7475

7576
```sql
7677
EXEC sp_execute_external_script
7778
@language = N'dotnet',
78-
@script = N'MyPackage.MyCLass',
79+
@script = N'MyPackage.MyClass',
7980
@input_data_1 = N'SELECT * FROM MYTABLE'
8081
WITH RESULT SETS((column1 INT));
8182
```

0 commit comments

Comments
 (0)