------------------------------------------ -- -- Demo Products Script -- Usage: Open with query analyser to fill -- the sample myProducts database -- ------------------------------------------ -- Make sure we're using the right database use myProducts go -- Delete any records if they exist DELETE FROM categories DELETE FROM products DELETE FROM descriptions go -- We will declare some variables that will -- hold the @@identity values etc DECLARE @intId [INT] -- We will add twenty items to our database -- and list each one as we create it SET NOCOUNT ON -- Entry #1 INSERT INTO CATEGORIES(catName) VALUES ('ASP') SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'Learning ASP in 24 hours version 1') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'Learning ASP is a book designed to help readers familiar with HTML to start to learn the basic fundamentals of ASP.') PRINT 'Created product with id #' + CONVERT(varchar, @intId) -- Entry #2 SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'ASP and SQL 2000: The power to develop') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'If you''re familiar with ASP and are looking to manipulate a database through script, then this is the book for you.') PRINT 'Created product with id #' + CONVERT(varchar, @intId) -- Entry #3 SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'Beginners guide to eCommerce with ASP and XML') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'eCommerce is dynamic, fun, flexible and profitable. Learn how to create award winning websites using ASP and XML in just 2 weeks.') PRINT 'Created product with id #' + CONVERT(varchar, @intId) -- Entry #4 INSERT INTO CATEGORIES(catName) VALUES ('VB.NET') SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'Exploring VB.NET Beta 2') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'With the recent release of VB.NET Beta 2, there are alot of changes, mainly those involving ADO.NET. Changes are vital and will help you to better understand the .NET framework') PRINT 'Created product with id #' + CONVERT(varchar, @intId) -- Entry #5 SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'Creating scalable web services using VB.NET') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'Web services are the new way to communicate cross server. Learning from Mike Johnson, you''ll be creating web services in no time!') PRINT 'Created product with id #' + CONVERT(varchar, @intId) -- Entry #6 INSERT INTO CATEGORIES(catName) VALUES ('C#.NET') SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'Migrating from C++ to C#') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'C++ is a powerful OOP language. C# is a powerful web based OOP language. Migration to C# for the web doesn''t have to be difficult. In this book John explains how, in just 30 days.') PRINT 'Created product with id #' + CONVERT(varchar, @intId) -- Entry #7 SELECT @intId = @@identity INSERT INTO PRODUCTS(productCat, productName) VALUES (@intId, 'Using C# and ADO.NET') SELECT @intId = @@identity INSERT INTO DESCRIPTIONS(descProdId, descText) VALUES (@intId, 'Databases drive dynamic content. Using C# and ADO.NET, you too can develop fast, and tightly integrated database websites in just hours.') PRINT 'Created product with id #' + CONVERT(varchar, @intId) PRINT '' PRINT 'Exiting with error level '+CONVERT(VARCHAR, @@error)+'.'