Formatting stored procedure in SQL Server 2014?

Code Formatting in Stored Procedure on any version of SQL Server:With the Editor you can format your code with indenting, hidden text, URLs, and so forth. You can also auto-format your code as you type by using Smart Indenting.Indenting You

Read More

How to convert multiple rows into single row in SQL Server 2008?

Today we will go through the steps in order to write the simplest query to combine multiple rows into single row in SQL Server 2008:  Step 1: Create a table CREATE TABLE [dbo].[Students] ( [Id] [int] IDENTITY(1,1) NOT NULL, [age]

Read More

Replace last occurrence of a string in SQL Server?

Step 1: Create a procedure in order to replace the last occurrence of a string with a specified string as shown below: CREATE PROC sp_ReplaceStringWithLastOccurence (       @Texto varchar(MAX),       @findString VARCHAR(100),       @replaceString VARCHAR(100) ) AS BEGIN     DECLARE @Pos INT=0,@startPos INT=0,@endPos INT=0,@totalStringLength

Read More

Pages (7)« 1234567 »