-
Notifications
You must be signed in to change notification settings - Fork 1
Letters
This collection of SQL artefacts can be used to randomly generate letter values, either singularly or in batches of up to 10000 values.
Bulk procedures described below generate values based on the values in [Reference].[Number]. This table can be populated by executing the procedure [Reference].[usp_Populate_Number].
This function will return a random letter value. As a function; this method can be used to easily assign a value to an variable, or to update a field on a table.
Example usages:
Declare @Letter char(1)
Select @Letter = [SingleValue].[ufn_Get_letter]()
This procedure will return a random letter value. The generated value is returned via the output parameter @Letter, and so can be captured in a variable or passed back to a calling application.
| Parameter | Data Type | Default Value | Direction |
|---|---|---|---|
| @Letter | char(1) | None | Output |
Example usages:
Declare @Letter char(1)
exec [SingleValue].[usp_Get_Letter] @Letter out
Select @Letter
This procedure will return up to 10000 random letter values. This procedure has the following input parameter:
| Parameter | Data Type | Default Value |
|---|---|---|
| @QuantityRequired | smallint | None |
A recordset with the following structure is returned:
| Field Name | Data Type |
|---|---|
| Letter | char(1) |
This method is useful for inserting bulk data directly in to a table, or as an ETL source.
Example Usage:
exec BulkValue.[usp_Get_Letter_Bulk] 1000