title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | dev_langs | |
---|---|---|---|---|---|---|---|---|---|---|
Performing catalog operations |
Describes how to execute commands that modify database schema. |
David-Engel |
davidengel |
v-chmalh |
11/25/2020 |
sql |
connectivity |
conceptual |
|
[!INCLUDEappliesto-netfx-netcore-netst-md]
[!INCLUDEDriver_ADONET_Download]
To execute a command to modify a database or catalog, such as the CREATE TABLE or CREATE PROCEDURE statement, create a Command object using the appropriate SQL statements and a Connection object. Execute the command with the xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A method of the xref:Microsoft.Data.SqlClient.SqlCommand object.
The following code example creates a stored procedure in a Microsoft SQL Server database.
[!code-csharpDataWorks SqlCommand.ExecuteNonQuery#3]