Chinese (People's Republic of China)  English  Français


Supinfo-Projects.com
Tous les projets des élèves ingénieurs de Supinfo



Projets
  Dernier Projet
  Les plus populaires
  Tous les Projets

260 Visiteurs
3168 Projets


My Supinfo-Projects

   Connectez-vous
   Créez un Compte


Synopsis

   15 Visites
   Note INTERNET : 20
    (1 Votants)
   25 Commentaires

   Lire l'article

Evaluez cet article

20
18
16
14
12
10
8
6
4
2
0


Commentez cet article

Auteur :

Email :

Votre commentaire :



 
2005 - Note de Synthèse Stage
Integrate DotNet in Sql Server 2005
[25 mn de lecture - paru le 10/29/2005 6:06:13 PM - Public : Confirmé]

Auteur

degrem_mMichel DEGREMONT
Elève-Ingénieur Supinfo Paris
Promotion SUPINFO 2006

   Lui écrire
   Tous les projets de cet auteur
   Le mini-CV de cet auteur

2. To create stored procedure with Visual Studio 2005

2.1. To create stored procedure

Choose in Exploring it solution "Stored Procedure"

sql_clr_7.jpg

Visual studio 2005 generates you directly a class partial StoredProcedures. As well as the attribute [ Microsoft.SqlServer.Server.SqlProcedure ] which will make it possible SqlServer 2005 to recognize that it is a stored procedure.

Not need to open connection because you will be connected to the object time of your procedure.

Simple example


using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;

partial public class StoredProcedures
{

[ Microsoft.SqlServer.Server. SqlProcedure ]
public static void MaProcedureStokee()
{
// your code here Could
SqlContext Pipe.Send( "Hello Word!!!" );
}
};
 

2.2. To deploy your procedure on Sql Server 2005

Compile your project. Here is your DLL east creates.

Then you must deploy your DLL,

Click right on the project > Deploy

sql_clr_13.jpg

To rock in Sql Server Management Studio (in the past undertaken to manage)

Make Refresh of your data base

sql_clr_10.jpg

In the tree structure of your data base: Programmabilty > > Assemblies > > SqlServeurProjectSupinfo. The DLL was well spread.

In the repertory: Programmabily > > Stored Procedures > > dbo.MaProcedureStokee you can see your stored procedure.

It is not of Transact SQL and if you wish to modify it you must modify your code in Visual Studio 2005.

To carry out the procedure you must create a new solution in SQL server 2005.

- Connected
- To create a new file of request

2.3. To activate the integration of the CLR in SQL Server 2005

If you have the message:

Msg 6263, Level 16, State 1, Line 1
Execution of to use code in the NET Framework is disabled. Use sp_configure "clr enabled" to enable execution of to use code in the NET Framework.
 

with the excécution of your stored procedure, it is that Frame work NET2 is decontaminated by defect in Sql Server 2005.

You must go in Sql server 2005 Surface Area Configuratoion > > Surface Area Configuration for Features.

 

Go in DataBase Engine > > CLR Intégration and coachman Enable CLR Integration, then Appliquer.

sql_clr_11.jpg

sql_clr_12.jpg

You can now carry out your stored procedure.

2.4. Safety and permissions of execution of the assemblies

It is necessary to be vigilant by defect you cannot carry out assemblies in SQL Server 2005 which make another thing that actions related to the data base.

For example if you wish to create a trigger which to create a file of loggues on your server with each time one removes a user in the data base, that it store the hour and the date of suppression and that in more one removes the account directly in Active Directory. Then you must go in the properties of your project > > in DataBase is to grant permissions external .

You have the choice between 3 levels:
- Safe: protected mode no access except to SQL Server 2005
- external: the assembly will have access to external sources like the access to the file, the regist, the networks...
- Unsafe: the protected mode which gives the full Access to the CLR in Sql Server 2005

sql_clr_15.jpg




Articles de la même catégorie

 Pages : Top


20 Visites
0 Commentaires
Théorie du vectorielle
[25 mn de lecture - paru le 10/29/2005 4:41:28 PM - Public : Expert]

En savoir plus


11 Visites
0 Commentaires
Prevent hacker attacking company database
[10 mn de lecture - paru le 10/29/2005 4:32:47 PM - Public : ÐÂÊÖ]

En savoir plus


15 Visites
0 Commentaires
What can make Windows server 2003 more secure
[10 mn de lecture - paru le 10/29/2005 1:12:50 PM - Public : ÐÂÊÖ]

En savoir plus

   Tous les Articles


SUPINFO Training Center peut vous proposer une formation ...

   Devenez Ingénieur Système Microsoft en 35 jours avec SUPINFO Training Center
   Devenez Certifiés Cisco en 13 jours avec SUPINFO Training Center
   Devenez Administrateur Système Microsoft avec SUPINFO Training Center
   Devenez Développeur Microsoft .NET en 13 jours avec SUPINFO Training Center



Powered by Campus-Booster Technology
Conditions d'utilisation & Copyright | Respect de la vie privée
© Copyright 1965-2006 Supinfo Paris, Paris Academy of Computer Science
Supinfo, Ecole Supérieure d'Informatique et Paris Academy Of Computer Science are trade marks.
23, rue de Château LANDON - 75010 PARIS - Phone : +33 (0) 153359 700 Fax : +33 (0) 153359 701

Web site autided by :