Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi i need to create a store proc 2

Status
Not open for further replies.

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
 
create procedure sp_concate
as
begin

select <string1> + ' ' + <string2> from <tablename>
end
 

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top