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.

Continue reading

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).

Continue reading