0
What about store procedures?
I want a couple of examples easy, medium and hard
2 Antworten
0
An easy example of a select:
USE [FinalBD]
GO
CREATE PROC usp_SelectEmp
AS
SELECT [CUIT]
,[NUM_PROYECTO]
,[NOMBRE]
,[CALLE]
,[NRO_CALLE]
,[TELEFONO]
,[COD_INT]
FROM [dbo].[EMPRESAS]
GO
and here is how you execute it:
EXEC usp_SelectEmp
sry, its in spanish
0
and here is if you need to use parameters:
USE [FinalBD]
GO
CREATE PROC usp_InsTrab
@COD int,
@DNI char(10),
@Nombre char(20),
@Apellido char(20)
AS
INSERT INTO [dbo].[TRABAJADORES]
([COD_TRAB]
,[DNI]
,[NOMBRE]
,[APELLIDO])
VALUES
(@COD
,@DNI
,@Nombre
,@Apellido)
GO
also in Spanish.