Stored Procedures [dbo].[UpdateDocumentNameExtensionOnly]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inMSSDocumentIDint4
@inNewDocumentNamenvarchar(128)256
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/*
* Description: Used to update the file extension of a document when Atlas is able to convert an
* image into a .pdf file.  Also updates the associated DocumentUploadStatus (if any).
**/

CREATE PROCEDURE [dbo].[UpdateDocumentNameExtensionOnly]
    @inMSSDocumentID int,
    @inNewDocumentName nvarchar(128)
as

set nocount on

declare @theOldDocumentName nvarchar(128)
declare @theOrderID int

update MSSDocument set
    @theOrderID = OrderFID,
    @theOldDocumentName = DocumentName,
    DocumentName = @inNewDocumentName
where MSSDocument.MSSDocumentID = @inMSSDocumentID

update DocumentUploadStatus set
    DocumentName = @inNewDocumentName
where OrderFID = @theOrderID and
    DocumentName = @theOldDocumentName
GO
GRANT EXECUTE ON  [dbo].[UpdateDocumentNameExtensionOnly] TO [MssExec]
GO
Uses