Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
5| Name | Data Type | Length | Description |
|---|---|---|---|
| @src | varchar | 255 | |
| @texto | varchar | -1 | |
| @id_slider | int | 4 | |
| @posicion | int | 4 | |
| @visible | bit | 1 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Samuel González>
-- Create date: <28 Jun 2017>
-- Description: <Insertar datos en tabla de imagenes>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.insertar_imagenes
-- parameters for the stored procedure
@src varchar(255),
@texto varchar(MAX),
@id_slider int,
@posicion int,
@visible bit
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
SET NOCOUNT ON;
DECLARE @id_aux int
-- INSERTAR
INSERT INTO imagenes_new (src, posicion, visible) values (@src, @posicion, @visible)
-- OBTENER el id de la nuevo imagen
SET @id_aux = SCOPE_IDENTITY()
-- SELECT ONE
SELECT
id_imagen, src, texto, posicion, id_slider, visible
FROM imagenes_new
WHERE id_imagen = @id_aux
END
GO
GO
-- =============================================
-- Author: <Samuel González>
-- Create date: <28 Jun 2017>
-- Description: <Insertar datos en tabla de imagenes>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.insertar_imagenes
-- parameters for the stored procedure
@src varchar(255),
@texto varchar(MAX),
@id_slider int,
@posicion int,
@visible bit
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
SET NOCOUNT ON;
DECLARE @id_aux int
-- INSERTAR
INSERT INTO imagenes_new (src, posicion, visible) values (@src, @posicion, @visible)
-- OBTENER el id de la nuevo imagen
SET @id_aux = SCOPE_IDENTITY()
-- SELECT ONE
SELECT
id_imagen, src, texto, posicion, id_slider, visible
FROM imagenes_new
WHERE id_imagen = @id_aux
END
GO
Depends On
1Used By
No items found