see i want to concatenate this
rupesh's and malviya
so how can i concenate it in sql server 2005 and also i want to know does it support double quotes?
see i want to concatenate this
rupesh's and malviya
so how can i concenate it in sql server 2005 and also i want to know does it support double quotes?
Try this:
DECLARE @COMBINED_STRINGS AS VARCHAR(50); -- Allocate just enough length for the two strings.
SET @COMBINED_STRINGS = 'rupesh''s' + 'malviya';
SELECT @COMBINED_STRINGS; -- Print your combined strings.
Or you can put your strings into variables. Such that:
DECLARE @COMBINED_STRINGS AS VARCHAR(50),
@STRING1 AS VARCHAR(20),
@STRING2 AS VARCHAR(20);
SET @STRING1 = 'rupesh''s';
SET @STRING2 = 'malviya';
SET @COMBINED_STRINGS = @STRING1 + @STRING2;
SELECT @COMBINED_STRINGS;
Output:
rupesh'smalviya
Just add a space in your string as a separator.
so if you have a table with a row like:
firstname lastname
Bill smith
you can do something like
select firstname + ' ' + lastname from thetable
and you will get "Bill Smith"