sql server - Adding a float default value in stored procedure but it says that it expect parameter -


After

I'm trying to input a duplicate of the room here

  My code for making proc spInsertToRoom @room_name varchar (50), @room_status varchar (50) = 'tblRoom (ROOM_NAME, room_status, room_rate) @ ROOM_NAME, @ room_status, @ room_rate select the end as' available' Code>  start @room_rate / former> 

I want to be automatically available. Then when I input one value it just says

  executive [spInsertToRoom] 'A102', 3500   

Process or function 'spInsertToRoom' The expected parameter is '@room_rate', which was not supplied.

But when I try this

executive [spInsertToRoom] 'A103', @ room_rate = 4000

Worked!

The reason I'm just wondering is that it needs to input @ room_rate = 4000 while a person just looked at what I saw on YouTube just like your pre-code Having a variable?

In this case you have to give the names of parameters in your call. What is going on with your code will turn this indirect varchar (50) into 3500 and after that there is no value for room_rate.

  Executive [spInsertToRoom] @room_name = 'A102', @room_rate = 3500   

I will make some recommendations I do not have to use float first when You want the numbers to be exact. Float is an approximate datatype, like some NUMERIC (9, 2) would be a better option

My second recommendation is to drop the prefix with your names, while searching for the name of the process it is noise and confused with something else Not likely to happen. If this was my system, then the name for this process would be Room_Insert by way of the procs object resolved by that they are working with and the verb is in the end. Room_Update, Room_Delete etc. will be next to the other in the list of sequential sorted processes (like in SSMS).

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -