Stored Procedures [dbo].[MssWebGetAccountProfileDocumentImage]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@accountProfileDocumentIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[MssWebGetAccountProfileDocumentImage]
    @accountProfileDocumentId int
AS
begin
    set nocount on

    declare @externalImageId int =
        (
            select top 1 AccountProfileDocument.ExternalImageFID
            from AccountProfileDocument
            where AccountProfileDocumentID = @accountProfileDocumentId
        )

      declare @theDocDbName sysname = dbo.GetDocDbName()
      declare @theDynamicSql nvarchar(500) = N'select DocumentImage from ' + convert(nvarchar(500),@theDocDbName) + N'..DocumentImage where DocumentImageID = @inExternalDBImageID'

      exec sp_executesql @theDynamicSql, N'@inExternalDBImageID int', @externalImageId
end
GO
GRANT EXECUTE ON  [dbo].[MssWebGetAccountProfileDocumentImage] TO [MssExec]
GO
Uses