SoftadminGuide.FieldStandard_ExistingSqlObjectWarning

Type: Stored procedure

Modifies a field created by SoftadminGuide.FieldStandard_SqlObjectName. Adds a warning that appears if the user has entered an object that already exists. The warning can be stopping (the user must confirm overwrite with a checkbox) or not.
Use one or more of the @AllowX parameters to control what kind of objects to allow.

Example

/*
	This example is supposed to be part of a guide procedure,
	inside the "If @Action = 'GetFields'" block.
*/
	-- Create a textbox with autosearch, used to enter a procedure name.
	EXEC SoftadminGuide.FieldStandard_SqlObjectName
		@FieldName = 'ProcedureNameField',
		@Label = 'Select a procedure',
		@IsMandatory = 1,
		@AllowStoredProcedures = 1, -- Finds only procedures
		@AllowNonExisting = 1; -- Also accept a name that does not exist.

	-- In case the user entered a non-existing object,
	-- show a warning and demand the user confirm overwrite by checking a box.
	EXEC SoftadminGuide.FieldStandard_ExistingSqlObjectWarning
		@ObjectFieldName = 'ProcedureNameField', -- Same fieldname as above.
		@ConfirmOverwriteCheckBoxFieldName = 'OverwriteConfirmationCheckboxField',
		@AllowStoredProcedures = 1;

Parameters

@ObjectFieldName mandatory varchar(300)
The name of a field created by [SoftadminGuide.FieldStandard_SqlObjectName].
@ConfirmOverwriteCheckBoxFieldName mandatory varchar(300)
Name of a field to hold a confirmation checkbox. The field will be created by this procedure, and hence should not be created elsewhere.
@AllowTables mandatory bit
@AllowViews mandatory bit
@AllowStoredProcedures mandatory bit
@AllowScalarFunctions mandatory bit
@AllowTableValuedFunctions mandatory bit
@AllowInlineTableValuedFunctions mandatory bit