answersLogoWhite

0


Best Answer

CREATE PROCEDURE SP_MENUMASTER_UPDATE(

@PARENT_ID INT(3)

,@MENU_NAME VARCHAR(100)

,@UR VARCHAR(100)

,@USR VARCHAR(255)

,@I_D INT(3)

,@ifvalue VARCHAR(50)

)

AS

BEGIN

CASE ifvalue

WHEN "newuser" THEN

UPDATE MENUMASTER SET USER=USR WHERE ID=I_D;

ELSE

UPDATE MENUMASTER SET PARENTID=PARENT_ID,MENUNAME=MENU_NAME,URL=UR

WHERE ID=I_D;

END CASE;

END

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you use case and else condition update and insert in sql server stored procedure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can You Write Trigger in Stored Procedures?

A trigger is a stored procedure. It is a special stored procedure that runs in response to some defined event, such as an insert into a table.


You created a stored procedure in sql server 2005 database and you called through aspnet page with connection then you are getting error as - Could not find stored procedure 'GetLoginInfo' solve pls?

The connections bruk.


Is a website stored on a single server?

No it can be stored on two or more server in collaboration.


Are webpages stored on modem?

No there are stored on a server


What is trigger in DBMS?

A trigger is a special kind of stored procedures that automatically executes when an event occurs in the database server. Insert, update and delete are called as events.


Difference between a local procedure and stored procedure?

local procedure wont store in database. Stored procedure store in database permanently and we can use it whenever we require. Other program also can use this stored procedure. And the transaction of stored procedure take care by DBA. But the local procedure transaction is take care by manually only


Where are the items that were formerly stored on server www1?

The items that were originally stored on this specific server still remain there today as this is still a server that is widely used. The information has had no reason to be transferred to another server.


Where are webpages stored?

web server


Where are all network files stored?

They're stored on the file server.


How to find unused stored procedures in sql server 2005?

There is no way to view this information by way of SQL Server Management Studio. You could write a stored procedure against the SYSObjects tables to gather the information. You can also obtain information regarding the create / last accessed|used date of many objects from the same resources.


Where are websites stored?

one copy of a website is stored on each of the web servers that is the local (on which the website is being resistered) and the other on the global web server(in California, U.S.A.).


What server are email attachments stored on?

dienstwagen