enterprise manager using the enterprise manager. purpose of the enterprise manager to design tables...
TRANSCRIPT
![Page 1: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/1.jpg)
Enterprise manager
Using the Enterprise manager
![Page 2: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/2.jpg)
Purpose of the Enterprise Manager
• To design tables
• To populate / update tables
• To draw diagrams of tables
• To create– Stored Procedures– Views– User privileges
![Page 3: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/3.jpg)
Opening the Enterprise Manager
• Choose the Enterprise Manager from the Start menu.
• Connect as for the Query Analyser
• Open the databases folder and find your database. Register
your server by clicking this icon.
![Page 4: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/4.jpg)
Enterprise manager screen
![Page 5: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/5.jpg)
Expand your database…
![Page 6: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/6.jpg)
Before you set up tables…
![Page 7: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/7.jpg)
After you set up tables…
![Page 8: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/8.jpg)
Table view
• The tables that you set up are User tables.
• The tables that are there for system administration are System tables.
• Sometimes it is useful to be able to see what tables are there and what is in them.
• To see what is in the tables, right click on the table and click ‘open table’.
![Page 9: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/9.jpg)
To draw a diagram…
![Page 10: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/10.jpg)
Diagrams folder
![Page 11: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/11.jpg)
To add a new one
• Right click in the diagram window!
![Page 12: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/12.jpg)
• The tables in your database are listed on the left.
• Click the ones you want on the diagram and Add them.
• Click Next and Finish.• The diagram is
generated.
![Page 13: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/13.jpg)
Stored Procedures
Make an SQL statement into a stored Procedure
![Page 14: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/14.jpg)
Example Query
Select categoryName,
cast(ProductName as char(12))as Product,
cast(([order details].unitPrice*Quantity)-Discount as decimal(10,2)) as income
from
categories join products on categories.categoryid = products.categoryid
join [order details] on products.productid = [order details].productid
![Page 15: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/15.jpg)
• Right click Stored Procedure
• Choose Add New Procedure
![Page 16: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/16.jpg)
• Change the [Procedure Name] to one of your own choosing.
• Paste or type in the SQL from the query.
• Click Check Syntax
![Page 17: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/17.jpg)
Stored Procedure Window
This one is called ProductSalesByCategory
![Page 18: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/18.jpg)
Stored
• Click OK. The procedure is now stored.
• This is what the browser will now show.
![Page 19: Enterprise manager Using the Enterprise manager. Purpose of the Enterprise Manager To design tables To populate / update tables To draw diagrams of tables](https://reader036.vdocuments.us/reader036/viewer/2022082613/5697c0311a28abf838cdb104/html5/thumbnails/19.jpg)
To Run in the Query Analyser
•You do not have write privilege to Northwind.
•Try to set up a stored procedure in your own database.