USP_DATAFORMTEMPLATE_VIEW_DESIGNATIONDATAPROVIDER

The load procedure used by the view dataform template "Designation Data Provider View"

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter used to load the fields defined on the form.
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@VANITYNAME nvarchar(512) INOUT Vanity Name
@HASIMAGE bit INOUT Has Image
@DETAILSURL nvarchar(2047) INOUT Details URL

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_DESIGNATIONDATAPROVIDER
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @VANITYNAME nvarchar(512) = null output,
    @HASIMAGE bit = null output,
    @DETAILSURL nvarchar(2047) = null output
)
as
    set nocount on;

    -- be sure to set this, in case the select returns no rows

    set @DATALOADED = 0;

    -- populate the output parameters, which correspond to fields on the form.  Note that

    -- we set @DATALOADED = 1 to indicate that the load was successful.  Otherwise, the system

    -- will display a "no data loaded" message.

    select @DATALOADED = 1,
           @VANITYNAME = D.VANITYNAME
    from dbo.DESIGNATION D
    where ID = @ID

  if exists(select * from dbo.DESIGNATIONIMAGE where DESIGNATIONID = @ID)
      set @HASIMAGE = 1
  else
      set @HASIMAGE =0

  select @DETAILSURL = DDL.DETAILSURL
  from dbo.DESIGNATIONDETAILSLINK DDL
  where DDL.DESIGNATIONID = @ID

    return 0;