0

What about store procedures?

I want a couple of examples easy, medium and hard

23rd Sep 2016, 1:44 PM
degreerichi
degreerichi - avatar
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
3rd Oct 2016, 4:03 AM
Fernando Martinez
Fernando Martinez - avatar
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.
3rd Oct 2016, 4:05 AM
Fernando Martinez
Fernando Martinez - avatar