Tham khảo tài liệu 'mastering sql server 2000- p16', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 770 CHAPTER 20 SQL-DMO using properties of the SQLServer object. For example once you ve instantiated a SQLServer object and connected it to a particular server you can use the Databases property of the SQLServer object to retrieve a Database object referring to a particular database Set objDatabase Northwind In this example objSQLServer is a SQLServer object. When this line of code is executed the objDatabase object will be set to point to the Northwind database owned by the specified SQL Server. You can also use the SQLServer object to perform operations that affect an entire server. For example you could use properties and methods of this object to drop a database set serverwide options or manipulate the default timeout for SQL Server logins. NOTE All of the sample code in this chapter was written with Visual Basic. Of course because SQL-DMO is a COM server you can use the objects methods and properties it exposes from any COM client language. You need to set a reference to the Microsoft SQLDMO Object Library in your client code to use these objects. In the following pages we ll list the properties methods and events of the SQLServer object. These lists will give you an overview of the tasks that you can perform directly with this object. But first we need to explain why there are two different SQLServer objects in SQL Server 2000. Later in this chapter in the section Creating and Connecting a SQLServer Object we ll show you an example of working with these objects. SQLServer and SQLServer2 SQL Server 2000 has two different objects to represent the entire SQL Server. The SQLServer object can be used with both SQL Server 2000 and earlier versions of SQL Server. The SQLServer2 object can be used only with SQL Server 2000. The SQLServer2 object includes all of the methods properties and events of the SQLServer object. In addition it exposes some new methods and properties that pertain only to SQL Server 2000. The SQLServer2 object is an .