VWD Database Explorer
ALTER PROCEDURE dbo.usp_OrderAdd
(
@MemberName varchar(5), @Name varchar(50), @Address varchar(255), @PostCode varchar(15), @County varchar(50), @country varchar(50), @SubTotal money, @Discount money,
@Total money
)
AS
INSERT INTO Orders(MemberName, OrderDate, Name, Address, County, PostCode, Country, SubTotal, Discount, Total)
VALUES (@MemberName, GETDATE(), @Name, @Address, @County, @PostCode, @Country, @SubTotal, @Discount, @Total)
RETURN SCOPE_IDENTITY()
This SPROC has three parts. The first and last lines establish the frame of the procedure and declare its name. The second section, within parentheses, names the parameters that will be used to carry out the procedure. The third part, the INSERT INTO statement following the AS command, describes the one SQL statement to actually execute.
In summary, VWD provides the Database Explorer for the creation, modification, and examination of databases. Generally, a web site will use an existing database, so the examination features are most useful. However, when testing a new site you can hop to the VWD Database Explorer to see if your pages are updating data correctly, or you can modify data to see how the pages handle the rendering. In addition to introducing the Database Explorer, this appendix discussed the following topics:
You can examine both data and metadata. The latter includes the list of fields in a table and details about how those fields are structured, including their exact spelling, data type, size, and other parameters that will be important when designing a page to use the fields.
When creating a database, table or view, or SPROC, the Database Explorer will kick off a wizard to guide you through the process. Keep in mind that when referring to your SQL Server Express install, you must use the syntax of (local)\SQLExpress.
For two reasons, use particular caution when modifying data or metadata for existing databases. First, others may be expecting the database to be in its original state for their Web Forms or Windows forms. Second, you may not be aware of the constraints and relationships that can be ruined by incorrect changes in the data or structure.