USP_DATAFORMTEMPLATE_EDITLOAD_EXCHANGESERVER

The load procedure used by the edit dataform template "Exchange Server Edit Form"

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.
@USERNAME nvarchar(100) INOUT User name
@PASSWORD nvarchar(100) INOUT Password
@DOMAIN nvarchar(250) INOUT Domain
@URL nvarchar(500) INOUT URL
@TSLONG bigint INOUT Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record.
@USEIMPERSONATION bit INOUT Use Exchange impersonation
@ISDEFAULTSERVER bit INOUT Default server
@SERVERCOUNT int INOUT

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_EXCHANGESERVER
                        (
                            @ID uniqueidentifier,
                            @DATALOADED bit = 0 output,
                            @USERNAME nvarchar(100) = null output,
                            @PASSWORD nvarchar(100) = null output,
                            @DOMAIN nvarchar(250) = null output,
                            @URL nvarchar(500) = null output,
                            @TSLONG bigint = 0 output,
                            @USEIMPERSONATION bit = null output,
                            @ISDEFAULTSERVER bit = null output,
                            @SERVERCOUNT int = null output
                        )
                        as
                        begin
                            set nocount on;

                            begin try
                            -- Open the symmetric key for encryption

                            exec dbo.USP_GET_KEY_ACCESS;

                            select 
                                @SERVERCOUNT = count(ID)
                            from
                                dbo.EXCHANGESERVER;

                            select
                                @USERNAME = EXCHANGESERVER.USERNAME,
                                @DOMAIN = EXCHANGESERVER.DOMAIN,
                                @URL = EXCHANGESERVER.URL,
                                @TSLONG = EXCHANGESERVER.TSLONG, 
                                @DATALOADED = 1,
                                @USEIMPERSONATION = USEIMPERSONATION,
                                @ISDEFAULTSERVER = ISDEFAULTSERVER
                            from
                                dbo.EXCHANGESERVER
                            where
                                EXCHANGESERVER.ID = @ID;        

                            -- Make sure we close the symmetric key

                            close symmetric key sym_BBInfinity;
                            end try

                            begin catch
                                -- Make sure we close the symmetric key

                                close symmetric key sym_BBInfinity;

                                exec dbo.USP_RAISE_ERROR;    
                                return 1;
                            end catch 

                            return 0;
                        end