Hola tengo una consulta a una base de datos Oracle usando OracleCommand y lo que quiero ahora es pasar la consulta usando SqlCommand; pero no se cómo escribir la consulta en SQL Server; la sintaxis es la siguiente:
Código C#:
Ver originalcommand.CommandText = "INSERT INTO S_VERROUSFACTICES (ID, UTILISATEURID, STATIONID, IDOBJETLIE, TYPEVERROU, DATEINSERTION, IDENFANT, CLEF) SELECT :VerrouId, :UtilisateurId, :StationId, :ObjetLieId, :TypeVerrou, :DateInsertion, :EnfantId, :Clef FROM DUAL";
command.Parameters.Clear();
newVerrouFacticeId = Guid.NewGuid();
command.Parameters.Add("VerrouId", OracleDbType.VarChar, ConnexionHelper.TransformGuidToRaw(newVerrouFacticeId), ParameterDirection.Input);
command.Parameters.Add("UtilisateurId", OracleDbType.VarChar, ConnexionHelper.TransformGuidToRaw(ConnexionHelper.UserId), ParameterDirection.Input);
command.Parameters.Add("StationId", OracleDbType.VarChar, ConnexionHelper.TransformGuidToRaw(ConnexionHelper.CurrentStationId), ParameterDirection.Input);
newVerrouFacticeObjetLieId = objParent.Id;
command.Parameters.Add("ObjetLieId", OracleDbType.VarChar, ConnexionHelper.TransformGuidToRaw(objParent.Id), ParameterDirection.Input);
newVerrouFacticeType = parent.Name.ToString();
command.Parameters.Add("TypeVerrou", OracleDbType.VarChar, newVerrouFacticeType, ParameterDirection.Input);
command.Parameters.Add("DateInsertion", OracleDbType.Date, Temps.Maintenant, ParameterDirection.Input);
command.Parameters.Add("EnfantId", OracleDbType.VarChar, ConnexionHelper.TransformGuidToRaw(obj.Id), ParameterDirection.Input);
command.Parameters.Add("Clef", OracleDbType.Long, objet is IVerrouillable ? (objParent as IVerrouillable).Clef : 0, ParameterDirection.Input);