Tag: User Defined Function
-
T-SQL Function to Return Current Timestamp as String
Sometimes, a DBA will have to make adhoc backups and it is ideal that these backup files are named with proper timestamp info. The below function returns current date and time as a string fomartted in ‘yyymmdd_hhmmss’ style: [sourcecode language=”sql”] /* Script to create a function to get current timestamp in the format of YYYYmmdd_hhmmss;…