SQL. Internal SQL functions and helper stored procedures

Internal SQL functions and helper stored procedures

Working with dates, money, and other types

function [dbo].[date_getWeeksTable] (num) - get the last num of weeks (number and start date of the week)

function as_num (str, digits) - displays the monetary representation of a number (in value 1,000,000.00).

Layout, lines

function split (str, divider) - divide the line str by separator (e.g. comma).

function as_htmlBlock (code, langID) - get the layout block.

function as_lang (code, text, part, langID) - to get the localized value of the label in the code and part.

function as_link (code, parameters) - get a link (code-internal page code)

function as_newLine(count) - returns line breaks (used for generating sql scripts).

function as_urlEncode(url) - URL decoding page#1088; Oki

function str_cyrillic2Latin - translation of the Cyrillic alphabet into the Latin alphabet

function str_htmlEncode - HTML recoding

function str_splitPart (value, divider, part) - get part of the string (first part=1 or second part=2) from the string @value


function sec_getUserRoles(username) - get all hospital roles

function as_md5 (s) - get the hash of a line (used for checking hashes in Robocass)

function sec_hasAccessByUsersRoles - check whether the user has access to the bundle users, roles

function sec_hasRight - check whether the user has the access @right

the sec_isUserInRole - function checks whether the user has this role.


function cat_getCatURL - get the category URL

function cat_getProductImageURL - get image URL

function cat_getProductURL - get the product URL

function list_getCatURL -get the category URL (for list directories)

function list_getProductURL - get the product URL (for list directories)

Working with database

stored procedure as_backup - make database backup

stored procedure as_checkDBDiff - compare 2 databases by structure

stored procedure as_print - trace a value in as_trace when executing some sql

stored procedure system_searchAllTables - search for a certain value throughout the database.


function payment_robokassa_getLink - get a payment link for Robocass

function rs_resourceLink - get a link to a resource image

stored procedure as_getSetting - get the setting value

Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started