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

Chú ý mỗi đầu ra là tiếp xúc như tên gọi "vùng đệm" + và không gian nhúng được loại bỏ khỏi tên. hàng mới được thêm vào sử dụng phương pháp AddRow và cột đều có dân đề cập đến chúng như là tài sản đầu ra. Một tài sản bổ sung được tiếp xúc cho mỗi cột với _IsNull hậu tố (ví dụ, ISNULL) để đánh dấu một giá trị là NULL | PartV Data Connectivity For i 1 To 20 CInt Rnd 100 Next End Sub This example works for a single output with the default name Output 0 containing a single integer column RandomInt. Notice how each output is exposed as name buffer and embedded spaces are removed from the name. New rows are added using the AddRow method and columns are populated by referring to them as output properties. An additional property is exposed for each column with the suffix _IsNull . IsNull to mark a value as NULL. Reading data from an external source requires some additional steps including identifying the connection managers that will be referenced within the script on the Connection Managers page of the editor. Then in the script additional methods must be overridden AcquireConnections and ReleaseConnections to open and close any connections and PreExecute and PostExecute to open and close any record sets data readers and so on database sources only . Search for the topic Extending the Data Flow with the Script Component in SQL Server Books Online for full code samples and related information. Destinations Data Flow destinations provide a place to write the data transformed by the Data Flow task. Configuring destinations is similar to configuring sources including both basic and advanced editors and the three common steps Connection Manager Specify the particular table file s view or query to which data will be written. Several destinations will accept a table name from a variable. Columns Map the columns from the data flow input to the appropriate destination columns. Error Output Specify what to do should a row fail to insert into the destination ignore the row cause the component to fail default or redirect the problem row to error output. The available destinations are as follows OLE DB Writes rows to a table view or SQL command ad hoc view for which an OLE DB driver exists. Table view names can be selected .