dmca premi badge 4 Stuff VS Replace function in SQL Server SQL Basic Concepts

Stuff VS Replace function in SQL Server

Stuff VS Replace function Stuff Function This function is used to replace string from the given start position, passed as 2nd argument with string passed as last argument. In Stuff function, 3rd argument defines the number of characters which are going to be replaced. Syntax:- STUFF ( character_expression , start , length , replaceWith_expression ) […]

Continue Reading
sql CTE e1548962960505 Case Statement/ Expression in SQL Server SQL Basic Concepts

Case Statement/ Expression in SQL Server

Case Statement/ Expression in SQL server  Sometimes we need to get one result output from multiple possible outcomes based on the evaluation of some expression. This expression can be a simple case expression which compares an expression with a set of Expression/Values to determine the result or it can be a search case expression where […]

Continue Reading

How to change the database collation

To change the collation of an database following commands can be used: ALTER DATABASE [database name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE  [database name]  COLLATE Newcollation ALTER DATABASE  [database name]  SET MULTI_USER For example , suppose if the name of your database is learningdb and you want to change the collation to the collation SQL_Latin1_General_CP1257_CI_AS, then following commands can be used:- ALTER DATABASE  learningdb  SET SINGLE_USER WITH ROLLBACKIMMEDIATE ALTER DATABASE  learningdb  COLLATE SQL_Latin1_General_CP1257_CI_AS ALTER DATABASE  learningdb  SET MULTI_USER

Continue Reading