... datafrom my SQLServer database into an XML document
format. How do I do that with SQLServer 2000?
Technique
To accomplish this task, you will create a Command object with the Transact -SQL ... copy it from
other chapters. Here is the code for the function:
Function BuildCnnStr(ByVal strServer As String,
ByVal strDatabase As String) As String
12.4 Retrieve XMLfromSQLServer ... an example of a T -SQL statement that retrieves
data fromSQLServer 2000 in an XML format. Click on the button labeled Retrieve
XML, and the data will be listed in the TextArea at the bottom...
... 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 ... the data you wish to send to the Web server.
Typically, the XMLdata packet includes a mixture of content:
!
XML data created from user input
!
XML data retrieved fromXMLdata islands or XML ... client and server
$
Server sends XML to the client
$
Client sends XML back to the server
Client Data sourceWeb server
Order info XML
Catalog XML Read catalog
Update
database
Build XML
data packet
12
4...
...
using System.IO;
using System .Data;
using System .Data. SqlClient;
private const String TABLENAME = "TBL0911";
private DataSet ds;
private SqlDataAdapter da;
private BindingManagerBase ... ConfigurationSettings.AppSettings[" ;Sql_ ConnectString"]);
// Create the command to retrieve the image from the database.
String sqlText = "SELECT BlobData FROM " + TABLENAME +
" ... retrieve the schema from the data source using the FillSchema( )
method of the DataAdapter. Add the row to a DataTable and use the Update( )
method of the DataAdapter to update the data source. Recipe...
... displayed in Figure 11.2.
Other Data Movement and Manipulation Tasks
P
ART
III
274
Both SQLServer 7.0 and SQLServer 2000 files can be used with the Bulk Insert task in
SQL Server 2000. You use the ... used with a SQLServer destination.
Bcp can be used to move datafromSQLServer to a text file, but that’s not possible
with the DTS Bulk Insert task.
N
OTE
•You cannot transform the data as it ... this
chapter.
In the release version of SQLServer 2000, the bcp utility generates a SQLServer 2000
format file, while the Bulk Insert task generates a SQLServer 7.0 format file.
N
OTE
F
IGURE
11.2
You...
... main core for SQLServer 2008 and installs the main
engine, data files, etc., to make SQLServer run.
• SQLServer Replication: When you want to send data changes not only on the database it is ... Microsoft SQLServer 2008, but have no prior
knowledge of SQLServer 2008. You may well have had exposure to other databases, such as MySQL,
Oracle, or Microsoft Access, but SQLServer uses ... the SQLServer Browser, which is another name for SQLServer Management
Studio, it will be disabled by default. Many SQLServer installations will be on servers, quite often on
remote servers;...
... Copy SQLServer Objects task gives you some special capabilities. It’s usually not as fast
as the Transform Data task, but it is the most convenient way to move objects from one SQL
Server database ... Copy SQLServer
Objects Task
IN THIS CHAPTER
• When to Use the Copy SQLServer Objects
Task 310
• The Source and the Destination 311
•Transfer Choices 312
•Other Properties of the Copy SQL Server
Objects ... Generated Format File
7.0
6
1 SQLCHAR 0 40 “” 1 stor_name
2 SQLCHAR 0 4 “” 2 stor_id
3 SQLCHAR 0 40 “” 3 stor_address
4 SQLCHAR 0 20 “” 4 city
5 SQLCHAR 0 2 “” 5 state
6 SQLCHAR 0 5 “” 6 zip
The rows...
... database and associated meta data between data-
base servers.
You can only use databases on SQLServer 7.0 or SQLServer 2000 as the source for these
transfer tasks. The destination must be SQL ... from one SQLServer to a separate SQLServer 2000.
It’s important to be able to move meta data along with the transfer of databases. SQL Server
stores most of the meta data needed for database manipulation ... all the data-
bases on a server. But the centralized meta data becomes a problem when you move an indi-
vidual database to a new server. Unless you include all the needed meta data, the database...
... PackageSQLServer object
If sUserID = “” Then
Set PkgSQL = DTSApp.GetPackageSQLServer(sServer, _
sUserID, sPassword, DTSSQLStgFlag_UseTrustedConnection)
Else
Set PkgSQL = DTSApp.GetPackageSQLServer(sServer, ... Methods”
‘Save to the local server
‘Use integrated security
pkg.SaveToSQLServer “(local)”, , , DTSSQLStgFlag_UseTrustedConnection
pkg.LoadFromSQLServer “(local)”, , , _
DTSSQLStgFlag_UseTrustedConnection, ... parameters:
•
ServerName
—The server where the package should be stored.
•
ServerUserName
—The logon name for the server specified in ServerName.
•
ServerPassword
—The password for the
ServerUserName
logon.
•
Flags
—Security...
... initial release of SQLServer 2000.
•
/i
—Call the wizard for import into SQL Server.
•
/x
—Call the wizard for export fromSQL Server.
•
/r
—The name of the data provider, such as MSDASQL for the Microsoft ... the SQLServer database used in the import or export, if the
/i
or
/x
parameter is used.
•
/y
—Prevent the SQLServer system databases from being seen in the lists of source and
destination databases.
•
/?
—Display ... wiz-
ard from the Start menu by selecting Start, Programs, Microsoft SQL Server, Import and
Export Data. You can also call it from the Enterprise Manager, from the DTSWiz command-
line utility, or from...
... watermark.
Loading fromSQLServer 2000 to SQLServer 2000
You can load datafrom one SQLServer 2000 database to another SQLServer 2000 database
with a Transform Data task, a Data Driven Query task, a Copy SQL ... the
LoadFromSQLServer
method to load a DTS package:
EXEC @hResult = sp_OAMethod @hPkg , ‘LoadFromSQLServer’ , NULL ,
@ServerName = @sServerName,
@ServerUserName = @sServerUserName,
@ServerPassword ... to load data.
Loading from a Text File to a SQLServer Database
You can use a Bulk Insert task, a Transform Data task, or a Data Driven Query task to load
data from a text file into SQL Server...
... performance.
Using bcp for Exporting fromSQLServer to Text Files
It is faster to use bcp to bulk copy datafromSQLServer to a text file than to use the
Transform Data task. The high-performance ... THE
DTS
O
BJECT
M
ODEL
619
Transformation2
Transformations
DestinationColumns
ScoreColumns
DataPumpTransformCopy
DataPumpTransformDateTimeString
TransformServerProperties
DataPumpTransformLowerString
DataPumpTransformMidString
DataPumpTransformReadFile
DataPumpTransformScript(DTSTransformScriptProperties2)
TransformServer
Column
Column
Property
DataPumpTransformUpperString
DataPumpTransformTrimString
DataPumpTransformWriteFile
37 ... the Data Driven Query task is so you can choose from between several
queries as the result of a transformation. With SQLServer 2000, you can also do this with a
Transform Data task by using a data...