SQL SERVER USP_PREAVISO

USE [OPC_CAUCION_IC] GO /****** Object: StoredProcedure [dbo].[usp_preaviso] Script Date: 09/16/2016 18:09:25 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_preaviso]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[usp_preaviso] GO USE [OPC_CAUCION_IC] GO /****** Object: StoredProcedure [dbo].[usp_preaviso] Script Date: 09/16/2016 18:09:25 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[usp_preaviso] ( @Fec varchar(20) = NULL ) AS BEGIN DECLARE @Default_lang nvarchar(200) SELECT @Default_lang = @@language SET LANGUAGE Español SET @Fec = ISNULL(@FEC,(SELECT (CONVERT(VARCHAR(20),GETDATE(),112)))) --SELECT DATEADD (D,15,@Fec) --JOGOMEZ Agrego descripcion select 'Usted debe mandar preaviso de renuncia para la fecha: ' + STUFF( DATENAME(weekday,DATEADD (D,15,@Fec) )+ ' ' + ' de ' + CONVERT(Varchar(200),DATENAME(MONTH,DATEADD (D,15,@Fec))) + ' de ' + CONVERT(Varchar(200),DATENAME(YEAR,Dateadd (D,15,@fec))) + ' ' + '...Es una buena fecha para renunciar' ,LEN(DATENAME(weekday,DATEADD (D,15,@Fec) ))+1,1,LTRIM(RTRIM(CONVERT(Varchar(200),DATENAME(DAY,DATEADD (D,15,@fec)))))) SET LANGUAGE @Default_lang END GO
Versión recuperada.....

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.