...
xmlTextBox.Text = ds.GetXml( );
Discussion
SQL Server 2000 introduced support for retrieving datainXML format using the FOR
XML clause. The .NET SQLServerdata provider SqlCommand object ... method can only be used with SQL statements that return XML
data, such as those with a FOR XML clause. The ExecuteXmlReader( ) method can also
be used to return ntext data containing valid XML. ... has an
ExecuteXmlReader( ) that allows you to retrieve an XML stream directly fromSQL
Server, where it returns an XmlReader that contains the results of the SQL query. The
ExecuteXmlReader(...
... BuildCnnStr(ByVal strServer As String,
ByVal strDatabase As String) As String
12.4 Retrieve XMLfromSQLServer 2000
Sometimes I have to pull datafrom my SQLServer database into an XML document
format. ... seen in How-To 12.2.
Steps
Open and run the Visual Basic .NET-Chapter 12 solution. From the main Web page,
click on the hyperlink with the caption How-To 12.4: Retrieving XMLfromSQLServer ... While xrCust.Read()
intAtts = xrCust.AttributeCount
If xrCust.NodeType <> System .Xml. XmlNodeType.XmlDeclaration
Then
If intAtts > 0 Then
For intCurrAtt = 0 To intAtts -...
...
“Manipulating XMLData on the Client Using DOM.”
Retrieving datafromXMLdata islands and documents
In addition to creating new content from user input, XMLdata packets can also
contain a copy ... Posting XMLDatafrom Client to Server 3
Client /Server XML Application Architecture
!
Use XML to communicate between client and server
$
Server sends XML to the client
$
Client sends XML ... 7: Posting XMLDatafrom Client to Server
Sending XMLDatafrom Client to Server
!
Client creates an XMLdata packet and posts it to
the server
Client Web server
XML
DOM
tree
1
XMLHTTP
object
2
XMLDOM
object
4
XML...
... // Create the connection and command.
SqlConnection conn = new SqlConnection(
ConfigurationSettings.AppSettings[" ;Sql_ ConnectString"]);
SqlCommand cmdWrite = new SqlCommand(sqlWrite, ... for the record from the binding manager.
int Id = (int)ds.Tables[TABLENAME].Rows[bm.Position]["ID"];
// Create the connection.
SqlConnection conn = new SqlConnection(
ConfigurationSettings.AppSettings[" ;Sql_ ConnectString"]); ... Byte array if it contains binary data or to a String if it contains character data.
The following code demonstrates this technique:
image = (Byte[])cmd.ExecuteScalar( );
A BLOB can be quite large...
...
Catalogs
Physical attributes and assertions for catalogs accessible
from the data source
Character_Sets Character sets
Check_Constraints Check constraints
Check_Constraints_By_Table Check ... Check constraints defined for a catalog
Collations Character collations
Columns Columns in tables and view
Column_Domain_Usage
Columns that are dependant on a domain defined in the
catalog
Column_Privileges ... All columns
CONSTRAINT_COLUMN_USAGE Columns that have a constraint defined on them
CONSTRAINT_TABLE_USAGE Tables that have a constraint defined on them
DOMAIN_CONSTRAINTS
User-defined data...
... can access a SQLServer instance
Learn SQLServer 2000 in 15 Minutes a Week: Basic
Installation
Part 2
by Michael Aubert
www.2000trainers.com
Welcome to the second article in my series SQLServer ... Directory Data Files Directory*
Default
Instance
\Program Files\Microsoft SQL
Server\ Mssql\Binn
\Program Files\Microsoft SQL
Server\ MSSQL$InstanceName\Binn
Named
Instance
\Program Files\Microsoft ... remote SQL Server
Server and Client Tools – Installs an instance of SQLserver and the Client Tools
Connectivity Only – Installs the Data Access Components (DAC) and Network Libraries so
applications...
...
Cancel Button.Click
Clears the data grid, rolls back the transaction, and closes the connection.
Form.Closing
Rolls back the transaction if it exists and closes the connection.
The C# code ... describe the different locking hints that
you can use, categorized according to their function.
Table 6-21. SQLServer locking hints for isolation level
Locking hint Description
HOLDLOCK ... Server Locks Object counter that
can be used to monitor lock activity.
For more information about database locks, using locking hints, or monitoring database
locks, see Microsoft SQL Server...
... shown in Listing 9.7.
L
ISTING
9.7
The On Batch Complete Phase and the
fctProgress
Function from the
UseAllPhases Task
Function BatchCompleteMain()
Call fctPhase
Call fctProgress
BatchCompleteMain ... use in fctProgress.
lLastInsertSuccessKey = DTSDestination(“OrderID”)
InsertSuccessMain = DTSTransformstat_OK
End Function
On Batch Complete Phase
The On Batch Complete phase occurs when a batch ... Created from One Table (Example
from Northwind Sample Database)
SHAPE
{SELECT CustomerID, CompanyName, ContactName, PostalCode
FROM Customers}
APPEND
(
{SELECT DISTINCT PostalCode, Region, Country FROM...
... actions, such
as importing datafrom other data sources and manipulating the data. You will see Integra-
tion Services in action in Chapter 7 when we look at building a backup maintenance plan.
Of ... OVERVIEW AND INSTALLATION
11
Figure 1-4. Naming the install instance
Choosing Service Accounts
SQL Server and other services, as defined in the Feature Selection screen (shown earlier in Figure ... locations of SQLServerdata directories
Creating the Reporting Services Database
As we selected Reporting Services to be installed, we need to create a database for the reporting
server to use....
... Task.
Transfer Choices
You have five primary choices for copying objects with a Copy SQLServer Objects task. You
make most of these choices by checking boxes on the Copy tab of the Copy SQL Server
Objects ... procedure in the directory for Chapter 12 on the book’s CD as a
Visual Basic Project, with files CreateExecuteSQLTask.vbp, CreateExecuteSQLTask.frm,
CreateExecuteSQLTask.frx, and CreateExecuteSQLTask.bas.
The ... sExistingConnectionName = “” Then
‘Create connection for Execute SQL Task
Set con = pkg.Connections.New(“SQLOLEDB”)
With con
.ID = fctNextConnectionID(pkg)
.Name = “con” & sBaseName
.DataSource...
... be SQLServer 2000. One or more databases can be
included in a database transfer. For each included database, you can choose to copy it or
move it.
You cannot resolve most naming conflicts in ... If
Main = DTSTaskExecResult_Success
End Function
Function fctLoopAgain
‘Replace the code in this function with your looping criteria
‘Check for looping condition
If DTSGlobalVariables(“LoopCount”).Value ... an easier time giving database
access permissions in the future.
F
IGURE
15.5
You can choose which jobs to include or exclude in the transfer.
Choosing to include only certain jobs probably makes...
... Visual Basic Code to Create a Data Mining Prediction Query Task
Option Explicit
Public Function fctCreateDataMiningQueryTask( _
pkg As DTS.Package2, _
Optional sBaseName As String = “DataMiningQueryTask”, ... Services Processing task in an ActiveX Script task.
You can set additional cube processing options in the Cube Processing Settings dialog (see
Figure 21.3), which you open with the Cube Settings ... that are executing one of the packages.
There is more information about using transactions in DTS packages in Chapter 24, “Steps and
Precedence Constraints.”
Creating the Task and Setting Its Properties
You...