TAILIEUCHUNG - ASP.NET at Work: Building 10 Enterprise Projects PHẦN 4

UnregisterSite Thủ tục lưu trữ Thủ tục này là đối diện của thủ tục lưu trữ registerSite. Nó được gọi là khi các ứng dụng không còn nhu cầu để thu thập các tập tin đăng nhập cho một trang web nhất định. Các thủ tục lưu trữ được định nghĩa trong | Building the Web Log Analyzer 175 ELSE BEGIN COMMIT TRAN SET @SiteID @tmpID END Listing registersite stored procedure continued The unregisterSite Stored Procedure This procedure is the opposite of the registerSite stored procedure. It is called when the application no longer needs to collect the log files for a given site. The stored procedure is defined in Listing . CREATE PROCEDURE dbo . unregisterSite @SiteID uniqueidentifier AS BEGIN TRAN DECLARE @SQLStatement nvarchar 2000 DECLARE @MachineName nvarchar 15 DECLARE @SiteIndex smallint DECLARE @TableName nvarchar 25 -- First delete the entries from the child table so as -- not to cause any Foreign key constraint violations. DELETE FROM LogSource WHERE Site @SiteID -- Then select the machine name and site index from the -- log site table that corresponds to this registered -- site so we can build our SQL statement dynamically. SELECT @MachineName MachineName @SiteIndex SiteIndex FROM LogSite WHERE ID @SiteID -- Remove the site entry. DELETE FROM LogSite WHERE ID @SiteID SET @TableName @MachineName N W3SVC CONVERT nvarchar 5 @SiteIndex -- And finally drop the entries table for this site. IF EXISTS SELECT FROM WHERE ID OBJECT_ID @TableName AND OBJECTPROPERTY ID N IsUserTable 1 BEGIN SET @SQLStatement N DROP TABLE @TableName EXECUTE sp_executesql @SQLStatement Listing unregisterSite stored procedure 176 Project 4 SET @SQLStatement N DROP VIEW vw_ @TableName EXECUTE sp_executesql @SQLStatement END EXIT_BATCH IF @@ERROR 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END Listing unregisterSite stored procedure continued The getRegisteredSites Stored Procedure This procedure is used by the log collector service through our data-access component to retrieve the list of sites for which logs need to be collected. It is also used by the application to retrieve the list of available sites on a specific computer. The stored procedure is defined in Listing . CREATE PROCEDURE .

TỪ KHÓA LIÊN QUAN
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.