TAILIEUCHUNG - Hướng dẫn học Microsoft SQL Server 2008 part 20

SQL Server Extensions PowerShell Với việc phát hành SQL Server 2008, Microsoft kết hợp các phần mở rộng mới cho PowerShell đặc biệt để làm việc với SQL Server. Việc đầu tiên trong số này là một mini-vỏ cấu hình sẵn với các file DLL cần tải và các nhà cung cấp sẵn để sử dụng. Tất cả các ví dụ đưa ra trước đó trong chương này chạy tốt trong tiêu chuẩn PowerShell . Phần còn lại của chương tập trung vào các tính năng mới tạo ra cho SQL Server 2008 | Part I Laying the Foundation s new-object SQLTBWS INST01 bkdir dbs dbs foreach-object db _ if -eq False -and -eq False dbname dt get-date -format yyyyMMddHHmmss dbbk new-object Database Full backup of dbname dbname Backup dbname Disk bkdir dbname _db_ dt .bak File s Simple Recovery Model has a Value Property of 3 if -ne 3 dt get-date -format yyyyMMddHHmmss dbtrn new-object Log Trans Log backup of dbname dbname Backup dbname Disk bkdir dbname _tlog_ dt .trn File s While the best method for creating and modifying tables in SQL Server is to use Transact-SQL scripts in some cases embedding this activity in application code is beneficial. Remote installation of application software is one good example. Take a look at the objects shown in Figure 7-4 used in creating tables. As shown in Figure 7-4 the database has a Tables collection which holds Table objects. Each Table object has a Columns collection which holds Column objects. Listing 7-6 shows the complete script to define our tables indexes and foreign keys. Define the Table object first and then create the Column objects set their properties and add the Column objects to the table s Columns collection. 152 Scripting with PowerShell 7 FIGURE 7-4 The SMO Database Table Index and Foreign Key objects 153 Part I Laying the Foundation After the table and columns have been defined the next step is to define an index and set its IndexKeyType property to indicate the index is a primary

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.