realize este procedure a ver si me facilita un poquito espero lograr resolverlo :3
Código SQL:
Ver originalCREATE PROCEDURE SP_conectarse
(
@Id INT,
--@Nombre_base VARCHAR(100),
--@Codigoconection VARCHAR(100),
@resultado VARCHAR(100) = Codigoconection
)
AS
BEGIN
IF (@Id = '1')
BEGIN
SELECT Nombre_base,Codigoconection
FROM BDcon
WHERE Id = @Id
END
ELSE IF (@Id = '2')
BEGIN
SELECT Nombre_base,Codigoconection
FROM BDcon
WHERE Id = @Id
END
ELSE IF (@Id = '3')
BEGIN
SELECT Nombre_base,Codigoconection
FROM BDcon
WHERE Id = @Id
END
ELSE IF (@Id = '4')
BEGIN
SELECT Nombre_base,Codigoconection
FROM BDcon
WHERE Id = @Id
END
ELSE IF (@Id = '5')
BEGIN
SELECT Nombre_base,Codigoconection
FROM BDcon
WHERE Id = @Id
END
END
EXEC SP_conectarse 3