Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Nouveau : 14 avril 2006
In this example, a user-defined function is executed, and the return code is printed.
The complete sample code is in the file InitializeAndEstablishConnection_C.cpp. You can download an archive containing the sample from the SQL Server Downloads page on MSDN.
This sample was developed using Microsoft Visual C++ 2005.
Remarque relative à la sécurité : |
|---|
| When possible, use Windows Authentication. If Windows Authentication is not available, prompt users to enter their credentials at run time. Avoid storing credentials in a file. If you must persist credentials, you should encrypt them with the Win32 crypto API. |
Exemple
Here is the sample user-defined function used by the application.
USE AdventureWorks
drop function fn_RectangleArea
go
CREATE FUNCTION fn_RectangleArea
(@Width int,
@Height int )
RETURNS int
AS
BEGIN
RETURN ( @Width * @Height )
END
GO
Remarque relative à la sécurité :