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

Việc kích hoạt tất cả các bảng Tạo điều kiện cho mỗi bảng trong cơ sở dữ liệu lớn để thay đổi theo dõi có thể được rườm rà - kịch bản lệnh ALTER cho mỗi bảng. May mắn thay, sp_MSforeachtable, một Microsoft không có giấy tờ thủ tục lưu trữ, là salve có gắn các vết thương. | Part VIII Monitoring and Auditing Enabling all tables Enabling every table in a large database for Change Tracking can be cumbersome scripting the ALTER command for every table. Fortunately sp_MSforeachtable an undocumented Microsoft stored procedure is the salve that binds the wound. sp_MSforeachtable executes like a cursor executing a command enclosed in single quotes for every table in the current database. The placeholder is replaced with the for every table. If an error occurs then it s reported in the message pane but sp_MSforeachtable trudges along with the next table. This script enables Change Tracking for every table in the current database EXEC sp_MSforeachtable ALTER TABLE Enable Change_tracking With track_columns_updated on Internal tables Change Tracking stores its data in internal tables. There s no reason to directly query these tables to use Change Tracking. However it is useful to look at the space used by these tables when considering the cost of using Change Tracking and to estimate disk usage. Query to find the internal tables. Of course your Change Tracking table s will have a different name SELECT . as table as ChangeTracking FROM i JOIN o ON JOIN s ON JOIN ct ON WHERE LIKE change_tracking ORDER BY table Result abbreviated table ChangeTracking -------------------------------- ----------------------------------- Armed with the name it s easy to find the disk space used. Because Change Tracking was just enabled in this database the internal table is still empty 1272 Change Tracking 59 EXEC sp_spaceused Result name rows reserved data index_size .

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.