How to convert date of birth in words in SQL Server?

Step 1: Below is the query that we can use in order to convert the date into words: declare @date datetime = '01-10-1985'--Input DateOfBirth declare @yr smallint = datepart(year, @date); declare @month smallint= datepart(month, @date); declare @day smallint = datepart(day,

Read More

How to display a string vertically in SQL Server?

Below I have mentioned 2 queries using which you can display a string vertically:Query 1: Using While loop: DECLARE @string VARCHAR(256) = 'welcome' DECLARE @cnt INT = 0; WHILE(@cnt < len(@string)) BEGIN     SET @cnt = @cnt + 1;     PRINT SUBSTRING

Read More

How to insert different comma separated values into different columns in SQL Server?

Step 1: Create a table in which we will insert the CSV Data using the below query:CREATE TABLE Test_Table(col1 NVARCHAR(200), col2 NVARCHAR(200), col3 NVARCHAR(200),col4 NVARCHAR(200),col5 NVARCHAR(200))Step 2: Create an SP that will break the CSV string into columns and insert the

Read More

Pages (7)« 1234567 »