Faculty of Science and Technology Database Fundamentals 2Outlines n SQL Server 2008 n Install guide n Using T-SQL... Faculty of Science and Technology Database Fundamentals 4... Faculty
Trang 1Lab 01 a
SQL Server 2008
Trang 2Faculty of Science and Technology Database Fundamentals 2
Outlines
n SQL Server 2008
n Install guide
n Using T-SQL
Trang 3SQL Server 2005
n Microsoft SQL Server 2005 extends the
performance, reliability, availability, programmability
n ease-of-use of SQL Server 2000.
n includes several new features that make it an
excellent database platform for :
n large-scale online transactional processing (OLTP)
n data warehousing
e-commerce applications
Trang 4Faculty of Science and Technology Database Fundamentals 4
Trang 5Prerequires Software
n .NET Framework 3.5
n MSXML
Trang 6Faculty of Science and Technology Database Fundamentals 6
Installation
n Reading:
how-to-install-sql-server-2008-a-step-by-step-guide.pdf
Trang 7Veryfy the installation
ENTER:
Trang 8Faculty of Science and Technology Database Fundamentals 8
n Enter the following command to connect to MSSQLSERVER using the
SQLCMD utility Enter the following Transact-SQL commands to
retrieve the server name:
SELECT @@SERVERNAME
GO
Trang 9n Confirm that the server name is returned, and then enter
the following command to exit the SQLCMD utility:
Exit
Trang 10Faculty of Science and Technology Database Fundamentals 10
SQL Server Management Studio
n Start à Programs à SQL Server 2008 à SQL
Server Management Studio
1 Enter Password (If exists )
2 click Connect
Trang 11SQL Server Management Studio (2)
Trang 12Faculty of Science and Technology Database Fundamentals 12
Using T-SQL
n File à New à Query with Current Connection
n Or click
SQL Edit toolbar
Trang 13SQL Editor Toolbar (1)
n Connect
Opens the Connect to Server dialog box Use this dialog
box to establish a connection to a server.
n Disconnect
Disconnects the current Query Editor from the server.
n Change Connection
Opens the Connect to Server dialog box Use this dialog
box to establish a connection to a different server.
n New Query with Current Connection
Opens a new Query Editor window and uses the connection information from the current Query Editor window.
Trang 14Faculty of Science and Technology Database Fundamentals 14
SQL Editor Toolbar (2)
Executes the selected code or, if no code is selected, executes all the code in the Query Editor
Enables the Transact-SQL debugger This debugger supports debugging actions such as setting breakpoints, watching variables, and stepping through code
Sends a cancellation request to the server Some queries cannot be
canceled immediately, but must wait for a suitable cancellation condition When transactions are canceled, delays might occur while transactions are rolled back
Check the syntax of the selected code If no code is selected, checks the syntax of the all code in the Query Editor window