Skip to content
Home » SQL Tutorial » Page 9

SQL Tutorial

This website provides a SQL Tutorial, SSRS, Power BI, Python, Azure basics and advanced tutorials for beginners and professionals

You will find out a step-by-step walk through of the basics and advanced topics with practical and include numerous hands-on activities.

How to access a data of table from another database in SQL Server?

How to copy a data of table from another database in SQL Server?

Suppose, you have a database1 and table1 and one another database2 and table2  in SQL server.

Now you are required to select data of a table1 of database1 from database2 of table2.

What would be a query for that?

Loading

SQL STUFF

SQL STUFF() function is used to delete a sequence of given length of characters from a string and inserting the given sequence of characters from the specified starting index.

Syntax

STUFF(String, Start, Length, Newstring)

String – It is the string to be modified.

Start  – The starting index from where the given length of characters will be deleted and new sequence of characters will be inserted.

Length -The number of characters to delete from string

Loading

SQL TRANSLATE()

 The SQL TRANSLATE() is a string function that is used to replaces a sequence of characters in a string with another sequence of characters.

The function replaces a single character at a time.  Until SQL Server 2016, we used use REPLACE() function to replace each character.

Loading