Views [dbo].[InvoiceLocks]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created9:53:56 AM Friday, December 7, 2018
Last Modified8:55:45 AM Thursday, December 5, 2024
Columns
Name
OrderFid
LockedByFullName
CreatedOn
OrderNo
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
/**
*    
*    User-friendly view of all invoice locks that exist in the InvoiceLock table.
*
*/


CREATE view [dbo].[InvoiceLocks]
(
    OrderFid,
    LockedByFullName,
    CreatedOn,
    OrderNo
)
as

select
    InvoiceLock.OrderFid,
    dbo.FormatFirstNameLastName( Sysuser.FIRSTNAME, Sysuser.LASTNAME ) as LockedByFullName,
    InvoiceLock.CreatedOn,
    Orders.OrderNo
from InvoiceLock
inner join Sysuser on InvoiceLock.CreatedBySysUserFid = Sysuser.SysUserID
inner join Orders on InvoiceLock.OrderFid = Orders.PriKey
GO
GRANT SELECT ON  [dbo].[InvoiceLocks] TO [MssExec]
GRANT INSERT ON  [dbo].[InvoiceLocks] TO [MssExec]
GRANT DELETE ON  [dbo].[InvoiceLocks] TO [MssExec]
GRANT UPDATE ON  [dbo].[InvoiceLocks] TO [MssExec]
GO
Uses