Create a procedure that displays the records of the IDs and the rates of the wrappers fromthe wrapper table when a user enters the description of the wrappers. On the basis of thedescription, the IDs and the rates of the corresponding wrappers should be displayed.
时间: 2024-02-12 08:08:27 浏览: 72
Sample script that displays all of the users in a given SQL Server DB
Sure, here's an example procedure in SQL that achieves this:
```
CREATE PROCEDURE display_wrapper_by_description
@description NVARCHAR(50)
AS
BEGIN
SELECT ID, Rate
FROM wrapper
WHERE Description = @description
END
```
When a user enters a description as a parameter to this procedure, it will display the ID and Rate of the corresponding wrapper(s) from the wrapper table. Note that this assumes that the `Description` column in the `wrapper` table is of type `NVARCHAR(50)`, but you can adjust the type and length of the parameter to suit your needs.
阅读全文