Developing and Deploying SQL Sever Apps on Windows Integrity
14 of 39
7. On the Solution Explorer, under the project, under scripts, you see the Post-
Deployment and Pre-Deployment folders, as shown below, that contain
numerous scripts for tuning the deployment scenario.
8. On the Visual Studio Project screen, write your Trigger. This sample trigger will not
allow programs to CREATE, ALTER, or DROP tables in the Adventure Works
database.
9. From the Build Menu, select Build project. This will validate the errors and
connections in the scripts and show it in the error list window.
10. From the Build Menu, select Deploy. The trigger will be deployed to the target
Integrity Server. If you have any problem with deployment, it may be because you
did not have a trusted data base connection or the appropriate permission level for
the database objects. Check that the permissions are correct.
11. To verify that the trigger works correctly, open the SQL Server management
Studio on the Integrity Server and try to delete a table in the Adventure Works
database as shown below:
DROP TABLE AdventureWorks.dbo.SalesPerson;
12. The table can not be dropped because the trigger will fire back as expected.
.NET CLR Stored Procedure
The following example shows step-by-step how a CLR c# stored procedure can be deployed
from a Windows Client to Integrity Server with single Click. The same procedure can be used
for any .NET applications(VB, .NET, or VC++ managed) development and deployment on
Integrity Server.
You must configure the CLR Integration before proceeding with this example as shown in Tools
section 2.2. Computers configured with large amounts of memory and a large number of
processors may fail to load the CLR integration feature of SQL Server when starting the
server. To address this issue, start the server by using the -g memory_to_reserve SQL
Server service startup option, and specify a memory value large enough. See more details
about Enabling CLR Integration
at the Microsoft web site.
1. To Launch Visual Studio SQL Server Projects, on the taskbar, click Start, point to
All Programs, then Microsoft Visual Studio 2005, then Microsoft Visual Studio