May 24, 2003 #1 pgtek Programmer Sep 28, 2001 1,180 CA Hi i need to create a store procedure and conconcatenates two string fields. can some one help me with the syntax th pg
Hi i need to create a store procedure and conconcatenates two string fields. can some one help me with the syntax th pg
May 25, 2003 1 #2 jcruzana Programmer Mar 13, 2003 4 PH create procedure sp_concate as begin select <string1> + ' ' + <string2> from <tablename> end Upvote 0 Downvote
May 25, 2003 1 #3 SonOfEmidec1100 Technical User Aug 12, 2001 965 AU If you want to use the value within the sp then CREATE PROCEDURE sp_MyTest AS DECLARE @NewString Varchar(1000) --length as needed SELECT @NewString = field1 + field2 FROM MyTable Or just to return the value then CREATE PROCEDURE sp_MyTest AS SELECT field1 + field2 as NewString from MyTable Upvote 0 Downvote
If you want to use the value within the sp then CREATE PROCEDURE sp_MyTest AS DECLARE @NewString Varchar(1000) --length as needed SELECT @NewString = field1 + field2 FROM MyTable Or just to return the value then CREATE PROCEDURE sp_MyTest AS SELECT field1 + field2 as NewString from MyTable