Stored Procedures [dbo].[MssWebUpdateDocumentProperties]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOrderIdint4
@inDocumentIdint4
@inDocumentTypeIdint4
@inDescriptionvarchar(64)64
@inNotevarchar(256)256
@inWorkTicketNumbervarchar(32)32
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[MssWebUpdateDocumentProperties]
    @inOrderId int,
    @inDocumentId int,
    @inDocumentTypeId int,
    @inDescription varchar(64),
    @inNote varchar(256),
    @inWorkTicketNumber varchar(32)
AS
BEGIN
    set nocount on
    
    ;with WorkTicketsCTE as (    SELECT TOP 1 WorkTicketID FROM WorkTickets
    Where WorkTickets.WorkTicketNumber = @inWorkTicketNumber)

    UPDATE MssDocument set
        DocumentTypeFID = @inDocumentTypeId,
        DocumentDescription = @inDescription,
        DocumentNotes = @inNote,
        WorkTicketFID = WorkTicketsCTE.WorkTicketID,
        LastModified = getdate()
    FROM MSSDocument
    OUTER APPLY WorkTicketsCTE
    where MssDocument.OrderFID = @inOrderId and
    MssDocument.MSSDocumentID = @inDocumentId
END
GO
GRANT EXECUTE ON  [dbo].[MssWebUpdateDocumentProperties] TO [MssExec]
GO
Uses