Estoy aprendiendo a crear procedimientos almacenados en SQL
queisiera saber si alguien me puede ayudar a llamar uno
desde ASP
Gracias
Saludos
Alejandro

| |||
![]() Hola Estoy aprendiendo a crear procedimientos almacenados en SQL queisiera saber si alguien me puede ayudar a llamar uno desde ASP Gracias Saludos Alejandro ![]() |
| |||
lo hice asi pero no me retorna el valor este es el codigo asp Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open "DRIVER={SQL Server};UID=fdfdd; PWD=sfsf;DATABASE=fdfd; SERVER=WSDEF" Set RS = Server.CreateObject("ADODB.RecordSet") Set RS = oConn.execute("EXEC csp_ciudad CIUDAD_ASEGURADO, DSC_CIUDAD") RESPONSE.WRITE(RS(0).value) este es el procedimiento CREATE procedure csp_ciudad (@cod_ciudad char(5), @dsc_ciudad varchar(50) output) as begin set nocount on select @dsc_ciudad = dsc_ciudad from geo_ciudad where cod_ciudad = @cod_ciudad select @dsc_ciudad set nocount off end |
| |||
Código:
Createparemeter("NOMBRE_PARAMETRO",tipoDeDato,dire ccion,Tamaño,valor) Set CoComando = Server.CreateObject("ADODB.Command") CoComando.ActiveConnection = Mi_Conn CoComando.CommandText = "SP_MiProc" CoComando.CommandType = 4 'Procedimiento Almacenado CoComando.Parameters.Append CoComando.CreateParameter("@RETURN_VALUE",3,4,4) CoComando.Parameters.Append CoComando.CreateParameter("@Nombre",200,1,100,'Tito') CoComando.Execute Id = CoComando.Parameters.Item("@RETURN_VALUE").Value |