To interact with Windows logs in a project, you must generate the following stored procedure script in the northwind database!

Source: Internet
Author: User

/* SQL scripts for daprototype */
Use northwind
go
/* Used in daprototype */
Create procedure spselcustomers
(
@ customerid varchar (5)
)
as
select
C. customerid, C. companyName, C. address, C. city
from MERs C
where c. customerid like @ customerid + '%'
go

/* Used in daprototype */
Create procedure spselorders
(
@ Customerid nchar (5)
)
As
Select O. orderid, O. customerid, O. orderdate
From
Orders o
Where o. customerid = @ customerid
Order by O. orderdate DESC
Go
/* Used in daprototype */
Create procedure spselorderdetail
(
@ Orderid int
)
As
Select OD. productid, OD. unitprice, OD. quantity, P. productname
From [Order Details] OD inner join products P
On OD. productid = P. productid
Where OD. orderid = @ orderid
Go

/* Used in daprototype */
Create procedure spuporderdetail
(
@ Orderid int,
@ Productid int,
@ Quantity int

)
As
Update [Order Details]
Set quantity = @ quantity
Where productid = @ productid and orderid = @ orderid
Go
/* Used in daprototype */
Create procedure spdelorders
(
@ Orderid int
)
As

SET transaction isolation level serializable
Begin transaction

Delete [Order Details] Where orderid = @ orderid
Delete orders where orderid = @ orderid

If @ error> 0
Rollback transaction
Else
Commit transaction
Go

/* Used in daprototype */
Create procedure spdelordersdemo
(
@ Orderid int
)
As
Delete orders where orderid = @ orderid
Go

/* Used in daprototype */
Create procedure spdeloddemo
(
@ Orderid int
)
As
Delete [Order Details] Where orderid = @ orderid
Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.