Database.Guide

Skip to content

Beginners

  • What is a Database?
  • Database Tutorial

SQL

  • SQL Tutorial
  • SQL Reference
  • SQL Joins Tutorial
  • SQL Transactions Tutorial
  • Basic SQL Queries

Categories

  • Azure SQL Edge (17)
  • Database Concepts (99)
  • Database Tools (72)
  • DBMS (9)
  • DuckDB (163)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (299)

Tag: how to

Replace a String with another String in SQL Server (T-SQL)

Posted on June 9, 2021 by Ian

In SQL Server you can use the REPLACE() function to replace all occurrences of a string with another string.

The function accepts three arguments; the string that contains the string to be replaced, the string to be replaced, and the string to replace it.

Continue reading →
SQL Server how to, mssql, string functions, t-sql

3 Ways to Convert a Date to a String in MongoDB

Posted on June 5, 2021 by Ian

MongoDB has a Date BSON type that allows you to store dates as dates.

You can also store dates as strings, if that’s what you need.

Taking it a step further, you can also convert a Date to a string.

This article presents three ways to convert a Date to a string in MongoDB.

Continue reading →
MongoDB convert, date format, dates, how to, string

Convert a Month Name to the Month Number in SQL Server (T-SQL)

Posted on June 3, 2021 by Ian

In SQL Server, you can use the MONTH() function to convert a month name to its corresponding number.

Continue reading →
SQL Server date format, dates, how to, mssql, t-sql

Insert Characters into the Middle of a String in SQL Server (T-SQL)

Posted on May 31, 2021 by Ian

SQL Server provides the STUFF() function that enables you to insert a string inside another string.

The function also allows you to specify the number of characters (if any) to delete from the original string in order to fit the new string.

Continue reading →
SQL Server how to, mssql, string functions, t-sql

3 Ways to Extract the Year from a Date in SQL Server (T-SQL)

Posted on May 30, 2021 by Ian

There are several ways to return the year from a date in SQL Server. Here are three (or is it four?).

Continue reading →
SQL Server dates, how to, mssql, t-sql

8 Ways to Add Seconds to a Datetime Value in MariaDB

Posted on May 26, 2021 by Ian

If you need to add one or more seconds to a datetime value in MariaDB, here are 8 options to consider.

Continue reading →
MariaDB dates, how to

3 Ways to Get the Month Name from a Date in MariaDB

Posted on May 22, 2021June 19, 2021 by Ian

Here are three ways to return the month name from a date in MariaDB.

Continue reading →
MariaDB date format, dates, how to

Subtract a Month from a Date in MariaDB

Posted on May 21, 2021 by Ian

MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a month (or many months) from a given date.

Here’s an example of subtracting a month from a date in MariaDB.

Continue reading →
MariaDB dates, how to

2 Ways to Get the Default Language of a Login in SQL Server (T-SQL)

Posted on May 20, 2021 by Ian

There are (at least) a couple of ways you can use T-SQL to return the default language of a specified login in SQL Server.

In particular, you can use the following methods:

  • Query the LOGINPROPERTY() function.
  • Query the sys.server_principals system catalog view in the master database.

Examples of these are below.

Continue reading →
SQL Server how to, mssql, security, t-sql

Rename a User Defined Data Type in SQL Server (T-SQL)

Posted on May 19, 2021 by Ian

In SQL Server, you can use the sp_rename stored procedure to rename a user created object in the current database, including a user-defined data type.

Continue reading →
SQL Server data types, how to, mssql
  • «
  • 1
  • …
  • 116
  • 117
  • 118
  • 119
  • 120
  • …
  • 182
  • »

About Database.Guide | Privacy Policy