update statement

is this sp is correct? all snytax and how I do update and select statements?
sp.txt
1jawsAsked:
Who is Participating?
 
Ephraim WangoyaCommented:
try
create procedure dbo.spMyTest

@id int,
@first nvarchar(200),
@last nvarchar(200),
@source varchar(20),
@target varchar(20)

as 
    update tblCheck
    set myfirstresult = dbo.MyFunction(@first ,@last,@target ),
        mylastresult dbo.MyFunction(@last ,@last,@target )
    where id=@id

select myfirstresult,mylastresult from tblCheck

Open in new window

0
 
santhimurthydCommented:
Syntax in SQL Server 2008

create procedure dbo.spMyTest
(
@id int,
@first nvarchar(200),
@last nvarchar(200),
@source varchar(20),
@target varchar(20)
)
as
Begin

update tblCheck set myfirstresult = dbo.MyFunction(@first ,@last,@target ),
                    mylastresult = dbo.MyFunction(@last ,@last,@target )
 where id=@id

select myfirstresult,mylastresult from tblCheck

end
0
 
1jawsAuthor Commented:
Thanks for all the help.. I went doing it different way...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.