
Understanding Usage of the Position Function
POSITION is a powerful function that helps you to find the position of a sub string in a string. Typically, the string is a column in a given table and

POSITION is a powerful function that helps you to find the position of a sub string in a string. Typically, the string is a column in a given table and

You can replace new lines and spaces inside a field with a statement similar to the following: REPLACE(REPLACE(LTRIM(RTRIM(FIELD_NAME)), CHAR(13), ”), CHAR(10), ”)

You can check which providers are installed on your server with this command: EXEC sp_MSset_oledb_prop

The following are two T-SQL methods that determine which version of SQL you are running. The first one is very short, using the @@VERSION?variable, whereas the longer method makes use

SQL Server 2016 introduces the DATEDIFF_BIG function that allows you to obtain date differences between larger date ranges. DateDiff_Big returns bigint. Here is a small example: SELECT DATEDIFF_BIG(SECOND, ‘19000101’, ‘20180403’)

You can easily find the day of the week for a given date in MySQL. The day starts with 1 (Sunday), 2 (Monday) and so on. Command: SELECT DAYOFWEEK(‘2018-02-20’); Expected

To find duplicates, use a query similar to the following: Select * from TABLE1 a where id ( select max(id) from TABLE1 b where a.Field=b.Field);

In order to execute a Stored Procedure when SQL Server starts, you first need to enable scanning for Startup Procedures with the following code: EXEC sys.sp_configure N’scan for startup procs’,

Deleting data in a database can a very dangerous operation in the wrong hands. Sometimes you are too busy to really concentrate fully; or sometimes you have given the wrong