Requete

mimosa803 Messages postés 345 Date d'inscription jeudi 15 février 2007 Statut Membre Dernière intervention 24 avril 2010 - 6 mars 2008 à 11:46
yann_lo_san Messages postés 1137 Date d'inscription lundi 17 novembre 2003 Statut Membre Dernière intervention 23 janvier 2016 - 6 mars 2008 à 20:11
    Bonjour, j'ai trouvé un problème à exécuté ma requête malgrès qu'elle marche sur Sql Server :
Voila la reqûete Sql :

select  distinct([name]),(select read_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=35465473) as Aread
,(select create_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=35465473) as ACreate
,(select update_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=35465473) as AUpdate
,(select delete_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=35465473) as ADelete
from sysobjects LEFT JOIN PROFILE_ACCESS_RIGHT
ON [name]=PROFILE_ACCESS_RIGHT.screen
where xtype='U'

Voila le code c# et voila l'erreur : Incorrect syntax near 'sysobjects'.

 try
        {

            cn.Open();

            string requete = "select  distinct([name]),(select read_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=@profile_id) as Aread" +
            ",(select create_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=@profile_id) as ACreate"    +
            ",(select update_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=@profile_id) as AUpdate" +
            ",(select delete_right from PROFILE_ACCESS_RIGHT where screen=[name] and profile_id=@profile_id) as ADelete" +
            "from sysobjects LEFT JOIN PROFILE_ACCESS_RIGHT ON [name]=PROFILE_ACCESS_RIGHT.screen where xtype='U'";
          

            SqlCommand cm = new SqlCommand(requete, cn);

J'espère que vous m'aidez
Merci

1 réponse

yann_lo_san Messages postés 1137 Date d'inscription lundi 17 novembre 2003 Statut Membre Dernière intervention 23 janvier 2016 26
6 mars 2008 à 20:11
Il suffit de voir la chaine en entier pour remarquer ceci :

...) as ADeletefrom sysobjects ...
0
Rejoignez-nous