I am creating a procedure in mysql but I am facing issues with the required result and now I am in a total mess. Please help me! The requirements is this: Get the Top 20 entries from the table, for the current day. By Top 20 entries, they should be the ones that occurred most often during the day –
Tag: stored-procedures
Find table name on the database using stored procedure on MySql 8.0.17
This is a list name of tables stored a database MySql version 8.0.17 The table name storage policy is Table_ Western alphabet letter (issued by an algorithm that recognizes the connected user, privileges, etc.)_ Random number_ Month Number_ Current Year I need find on the database MySql all the table for first Western alphabet letter without Random_number for this return
Invalid Datatype for user defined table type
I have declared the following user defined table type Now when i pass it as parameter to an SP I keep getting the following error Parameter or variable has invalid datatype Answer You must pass this argument as :
SQL procedure group by parameter value
I want to use group by functionality with dynamic value. Ex: When I code like this I get the error == > Each GROUP BY expression must contain at least one column that is not an outer reference. Any workaround for this? Answer You need to be very careful with this type of code as it is prone to SQL
How to remove While loop inside stored procedure in MS SQL Server? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year. Improve this question I have a stored procedure with a cursor inside for the logic which is taking long time for execution . I
Insert row with uniqueidentifier
This is a snippet from a stored proc that creates a database. We have a table with uniqueidentifier PK. I’m trying to insert a row with an empty guid as the PK: The error messages are Can’t see what’s wrong with the VALUES clause but I guess it has something to do with the final quote, although the final quote
SQL Exit scalar function prematurely
In SQL, you can exit the stored procedure prematurely with RETURN statement. However, when I try to apply the same principle to the scalar function, it returns the error, since function needs to return something. How do I prematurely exit the scalar function the same way RETURN is used in the stored procedure? Thank you. Answer You can’t RAISERROR or
How to compute running balance from array in ASP.NET MVC controller?
This is my code in controller I want to implement running balance in this array. This query will return Date, debit, credit and balance columns. I have to compute balance on the basis of debit and credit. I want to achieve this: for each row of the array. Hope, you get my point…help me….thanks Answer I have solved the problem.
Adding text and image to database with C# and SQL
The following windows form application takes an input for name, age, gender, description, and an image. However when clicking the “Save Information” button the following exception error …
Getting Error as @Parameter1 is not a parameter for procedure
I am learning mvc from this video where I am getting data from a form and saving it to database. When I ran my code first it gave an error stating Procedure or function ‘spAddEmployee’ expects parameter ‘@Employee_Name’, which was not supplied. I followed a solution in which I initialized my stored procedure as NULL but now I am getting