Return the Current Workstation Name that’s Connected to SQL Server (T-SQL)

Occasionally you might find yourself in the situation where you need to get the name of the current workstation that’s connected to SQL Server.

For example, maybe you have a stored procedure that inserts data, and you want to record the name of the workstation that inserted the data.

In such cases, you can use the HOST_NAME() function.

This is not to be confused with getting the server name.

Read more

RPAD() Function in Oracle

In Oracle, the RPAD() function allows you to pad the right part of a string with a certain character, to a specified number of characters.

The way it works is, you specify how long the resulting string should be. If the original string is shorter, the padding character fills in the remaining space.

Read more

LPAD() Function in Oracle

In Oracle, the LPAD() function allows you to pad the left part of a string with a certain character, to a specified number of characters.

The way it works is, you specify how long the resulting string should be. If the original string is shorter, the padding character fills in the remaining space.

Read more

TRANSLATE() Function in Oracle

In Oracle, the TRANSLATE() function allows you to make several single-character, one-to-one substitutions in one operation.

It returns the string provided as a first argument after some characters specified in the second argument are translated into a destination set of characters specified in the third argument.

It’s similar to the REPLACE() function, except that the REPLACE() function replaces the whole string with another string (i.e. not character by character, like TRANSLATE() does).

Read more