Click here to Skip to main content
16,011,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am saving my image with ImageName,'_',Id and .jpg
like Image name=abc,and Image Id=49
then image saved like abc_49.jpg
in case of editing image i am writing like that means

I write procedure like that
SQL
begin
    
        update tblGallery set

        Caption = @Caption,
        ImageName =@Caption+'_'+ @GalleryID +'.jpg'
        where GalleryID = @GalleryID

    end
and also like that
begin
    select @@Identity;
        update tblGallery set

        Caption = @Caption,
        ImageName =@Caption+'_'+ @@Identity +'.jpg'
        where GalleryID = @GalleryID

    end


but its not working can u suggest me how to do that.
Posted
Updated 27-Apr-12 22:32pm
v4

1 solution

Why are you putting a semicolon in the query above?

Try:
SQL
--Part of the SQL Procedure code
begin
        update 
           tblGallery 
        set
           Caption = @Caption,
           ImageName =@Caption+'_'+ @GalleryID +'.jpg'
        where 
           GalleryID = @GalleryID
end


Have a look at details here: Stored Procedures: Parameters, Inserts and Updates[^]
 
Share this answer
 
Comments
Rohit Sharma706 28-Apr-12 4:31am    
sorry its my mistake there is a no semicolon.
update
tblGallery
set
Caption = @Caption,
ImageName =@Caption+'_'+ @GalleryID +'.jpg'
where
GalleryID = @GalleryID
Sandeep Mewara 28-Apr-12 5:20am    
And what is the issue? Any error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900