Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > MS SQL Server
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 04-02-2009
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.445
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Pues yo lo he probado y funciona perfectamente, salvo por una cosa:
* En el CREATEPROCEDURE te falta un espacio entre ambas palabras (supongo que es error de transcripción)

Supongo además que cuando ya está creado, utilizas ALTER PROCEDURE en lugar de CREATE PROCEDURE para modificarlo. Por lo demás lo dicho, a mi me funciona bien.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #2  
Antiguo 04-02-2009
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.740
Poder: 26
ContraVeneno Va por buen camino
Salvo el espacio en "CREATE PROCEDURE", a mi también me funcionó bien.
__________________

Responder Con Cita
  #3  
Antiguo 04-02-2009
Avatar de jcarteagaf
[jcarteagaf] jcarteagaf is offline
Miembro Premium
 
Registrado: abr 2006
Ubicación: La Paz, Bolivia
Posts: 651
Poder: 21
jcarteagaf Va por buen camino
Si el procedimiento no existe deberias usar CREATE PROCEDURE en vez de ALTER PROCEDURE y ademas creo que deberias asignar el valor a tu variable de salida:


Código SQL [-]
CREATE PROCEDURE [dbo][SP_EXISTE_EMPRESA] 
-- Add the parameters for the stored procedure here
@SP_NOMBRE NVARCHAR(50), 
@NOMBRE NVARCHAR(50]) OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
  SET NOCOUNT ON;
  SELECT @NOMBRE = EMPRESAS.NOMBRE FROM EMPRESAS 
  WHERE EMPRESAS.NOMBRE = @SP_NOMBRE
  RETURN @NOMBRE
 
END

Saludos

Última edición por jcarteagaf fecha: 04-02-2009 a las 22:00:30.
Responder Con Cita
  #4  
Antiguo 04-02-2009
mierda mierda is offline
Miembro
 
Registrado: may 2006
Posts: 129
Poder: 21
mierda Va por buen camino
Pa mi q te falta esto

SELECT @nombre = EMPRESAS.NOMBRE FROM EMPRESAS
WHERE EMPRESAS.NOMBRE = @SP_NOMBRE

Un saludo

Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
procedimiento almacenado sargento elias Firebird e Interbase 1 14-04-2008 13:04:35
Procedimiento almacenado efelix MS SQL Server 7 21-11-2007 17:53:00
ejecutar Procedimiento almacenado en SQL Server, Intraweb. Roilo Internet 9 25-07-2007 18:01:32
Procedimiento Almacenado scooterjgm Conexión con bases de datos 5 18-01-2005 18:21:32
Procedimiento Almacenado Ulises Providers 3 30-01-2004 18:14:58


La franja horaria es GMT +2. Ahora son las 10:31:00.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi