Skip to content

Instantly share code, notes, and snippets.

@mariochavez
Created July 2, 2010 23:54
Show Gist options
  • Save mariochavez/462105 to your computer and use it in GitHub Desktop.
Save mariochavez/462105 to your computer and use it in GitHub Desktop.
USE [Codigos]
GO
/****** Object: StoredProcedure [dbo].[GetFractionInfo] Script Date: 07/02/2010 16:57:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetFractionInfo]
(
@clientId int,
@fraction nvarchar(8)
)
AS
SET NOCOUNT ON
SELECT f.Fraction, f.Sensible, COALESCE(cp.[Rule], '') AS [Rule], COALESCE(cp.ExpirationDate, GETDATE()) AS ExpirationDate,
COALESCE(cp.Charter, '') AS Charte, COALESCE(cp.Amount, 0) AS Amount
FROM Fraction AS f LEFT OUTER JOIN
ClientProgram AS cp
ON f.Fraction = cp.Fraction AND cp.ClientId = @clientId
WHERE f.Fraction = @fraction
RETURN
USE [Codigos]
GO
/****** Object: StoredProcedure [dbo].[InsInvoiceData] Script Date: 07/02/2010 16:17:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[InsInvoiceData]
(
@FileName nvarchar(50),
@File image,
@CustomDocumentDetailId int
)
AS
SET NOCOUNT ON
DECLARE @FileSize int
SET @FileSize = DATALENGTH(@File)
INSERT INTO InvoiceData(FileName, FileSize, [File], CustomDocumentDetailId)
VALUES(@FileName, @FileSize, @File, @CustomDocumentDetailId)
RETURN
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment