Showing posts with label document. Show all posts
Showing posts with label document. Show all posts

Monday, March 26, 2012

Load an XML doc from a file

I'm trying to do something similar to the code below, but I want to load the
XML document from a file on disk (ex.: c:\temp\mydoc.xml) instead of pasting
it into my code. Is there a way to do this in MSSQL 2005?
Thank you.
DECLARE @.idoc int
declare @.xmlDocument xml
set @.xmlDocument = N'<?xml version="1.0"?>
<gpx version="1.1"
creator="GMapToGPX 4.14 - http://www.elsewhere.org/GMapToGPX/"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd">
<rte>
<name>Gmaps Pedometer Route</name>
<cmt>Permalink: <![CDATA[Permalink temporarily unavailable.]]>
</cmt>
<rtept lat="32.45358" lon="-110.97512">
<name>Start</name>
<ele>901.73556</ele>
</rtept>
<rtept lat="32.4537" lon="-110.97549">
<name>Turn 1</name>
<ele>902.01902</ele>
</rtept>
<rtept lat="32.45377" lon="-110.97594">
<name>Turn 2</name>
<ele>901.95196</ele>
</rtept>
<rtept lat="32.45376" lon="-110.97653">
<name>Turn 3</name>
<ele>902.22324</ele>
</rtept>
</rte>
</gpx>'
EXEC sp_xml_preparedocument @.idoc OUTPUT, @.xmlDocument, '<gpx
xmlns:gpxns="http://www.topografix.com/GPX/1/1"/>'
-- Execute a SELECT statement that uses the OPENXML rowset provider.
SELECT * FROM OPENXML (@.idoc, '/gpxns:gpx/gpxns:rte/gpxns:rtept',3)
WITH (lat float, lon float, name varchar(60) 'gpxns:name', ele float
'gpxns:ele')
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.com
Alain Quesnel wrote:

> declare @.xmlDocument xml
> set @.xmlDocument = N'<?xml version="1.0"?>
One way is like this
SET @.xmlDocument = (
SELECT * FROM OPENROWSET(
BULK 'C:\dir\subdir\subdir\file.xml',
SINGLE_BLOB
) AS x
);
then you can use the variable @.xmlDocument as you have done before with
the stored procedure.
See the documentation here:
<http://msdn2.microsoft.com/en-us/library/ms191184.aspx>

Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/

Load an XML doc from a file

I'm trying to do something similar to the code below, but I want to load the
XML document from a file on disk (ex.: c:\temp\mydoc.xml) instead of pasting
it into my code. Is there a way to do this in MSSQL 2005?
Thank you.
DECLARE @.idoc int
declare @.xmlDocument xml
set @.xmlDocument = N'<?xml version="1.0"?>
<gpx version="1.1"
creator="GMapToGPX 4.14 - http://www.elsewhere.org/GMapToGPX/"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd">
<rte>
<name>Gmaps Pedometer Route</name>
<cmt>Permalink: <![CDATA[Permalink temporarily unavailable.]]>
</cmt>
<rtept lat="32.45358" lon="-110.97512">
<name>Start</name>
<ele>901.73556</ele>
</rtept>
<rtept lat="32.4537" lon="-110.97549">
<name>Turn 1</name>
<ele>902.01902</ele>
</rtept>
<rtept lat="32.45377" lon="-110.97594">
<name>Turn 2</name>
<ele>901.95196</ele>
</rtept>
<rtept lat="32.45376" lon="-110.97653">
<name>Turn 3</name>
<ele>902.22324</ele>
</rtept>
</rte>
</gpx>'
EXEC sp_xml_preparedocument @.idoc OUTPUT, @.xmlDocument, '<gpx
xmlns:gpxns="http://www.topografix.com/GPX/1/1"/>'
-- Execute a SELECT statement that uses the OPENXML rowset provider.
SELECT * FROM OPENXML (@.idoc, '/gpxns:gpx/gpxns:rte/gpxns:rtept',3)
WITH (lat float, lon float, name varchar(60) 'gpxns:name', ele float
'gpxns:ele')
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.comAlain Quesnel wrote:

> declare @.xmlDocument xml
> set @.xmlDocument = N'<?xml version="1.0"?>
One way is like this
SET @.xmlDocument = (
SELECT * FROM OPENROWSET(
BULK 'C:\dir\subdir\subdir\file.xml',
SINGLE_BLOB
) AS x
);
then you can use the variable @.xmlDocument as you have done before with
the stored procedure.
See the documentation here:
<http://msdn2.microsoft.com/en-us/library/ms191184.aspx>
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/|||Works like a charm.
Thank you,
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.com
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:OLcWpOogHHA.2368@.TK2MSFTNGP04.phx.gbl...
> Alain Quesnel wrote:
>
> One way is like this
> SET @.xmlDocument = (
> SELECT * FROM OPENROWSET(
> BULK 'C:\dir\subdir\subdir\file.xml',
> SINGLE_BLOB
> ) AS x
> );
> then you can use the variable @.xmlDocument as you have done before with
> the stored procedure.
> See the documentation here:
> <http://msdn2.microsoft.com/en-us/library/ms191184.aspx>
>
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/

load all data without knowing old one was load in the previous time?

I just have done the SSIS example in the tutorial document included when install SQL 2005 ENT. I have a problem that whenever I test to run, the service load all data from source with out noticing about the data (I mean it load all the data to the destination), I do it several time and it continue to load all without checking. That mean the data is dublicated when the schedule run?

I think there should be a paramete or something like that to help the engine just load the new data to the destination. Could you help please?

Thank

Hi Cao Van,

Ofcourse when you run the package every time it means you are inserting duplicate rows. To avoid this, I have two familiar methods

1) Truncate the destination table, everytime when you load the data from source and populate the detination table. (This is always time consuming process)

2) Use Look up concept to filter out the duplicates.

Thanks

Subhash Subramanyam

|||

In other words, you are the responsible of putting enough logic to avoid loading duplicate rows in your destination. Subhassh suggestions are very valid. For the first one you can use an execute sql task in control flow, right before the data flow to perform the TRUNCATE. For the second option, make sure you search the forum; there have been many discussions around that, actually in the first page of the forum, there is a sticky post that talks about it.

sql

Load a bitmap image into Reporting services

After scanning a document, can one load the resultant bitmap image into
Reporting services and be able to edit it.
eg. lets say a portion of the document was
Name : _______________
Surname : _______________
ID No. : _______________
Now where the underlined parts are, can one then go and edit it and Add a
field from a dataset.
The reason I ask is that I have several 20 odd page documents to create in
reporting services.
We want to automate the process whereby the users capture the neccasary data
in our application and the report is generated from this.
Now it may take forever doing this manually because will have to worry about
whether each page fits properly,
formatting and as the report gets larger the response times in Visual studio
is horrendous.
So I was just wondering if this were possible.
Or if anyone else has any other suggestions. Am using VS2005.
Thanks
SanjeevYou can put the image using image control, but not possible to edit. What you
can do is to put the document images as background and align the textbox
exactly as a entry field just next to the fields which require a value. This
way you can try, but not sure you may face some problem when you export to
different formats.
Amarnath, MCTS
"Sanjeev Rampersad" wrote:
> After scanning a document, can one load the resultant bitmap image into
> Reporting services and be able to edit it.
> eg. lets say a portion of the document was
> Name : _______________
> Surname : _______________
> ID No. : _______________
> Now where the underlined parts are, can one then go and edit it and Add a
> field from a dataset.
> The reason I ask is that I have several 20 odd page documents to create in
> reporting services.
> We want to automate the process whereby the users capture the neccasary data
> in our application and the report is generated from this.
> Now it may take forever doing this manually because will have to worry about
> whether each page fits properly,
> formatting and as the report gets larger the response times in Visual studio
> is horrendous.
> So I was just wondering if this were possible.
> Or if anyone else has any other suggestions. Am using VS2005.
> Thanks
> Sanjeev
>
>|||Thanks. Its worth a shot.Will try it as a background.
I just have to worry about exporting only to pdf..
"Amarnath" <Amarnath@.discussions.microsoft.com> wrote in message
news:853A1C5B-39F5-4EBF-BBD0-BA59F92D46D0@.microsoft.com...
> You can put the image using image control, but not possible to edit. What
> you
> can do is to put the document images as background and align the textbox
> exactly as a entry field just next to the fields which require a value.
> This
> way you can try, but not sure you may face some problem when you export to
> different formats.
> Amarnath, MCTS
>
> "Sanjeev Rampersad" wrote:
>> After scanning a document, can one load the resultant bitmap image into
>> Reporting services and be able to edit it.
>> eg. lets say a portion of the document was
>> Name : _______________
>> Surname : _______________
>> ID No. : _______________
>> Now where the underlined parts are, can one then go and edit it and Add a
>> field from a dataset.
>> The reason I ask is that I have several 20 odd page documents to create
>> in
>> reporting services.
>> We want to automate the process whereby the users capture the neccasary
>> data
>> in our application and the report is generated from this.
>> Now it may take forever doing this manually because will have to worry
>> about
>> whether each page fits properly,
>> formatting and as the report gets larger the response times in Visual
>> studio
>> is horrendous.
>> So I was just wondering if this were possible.
>> Or if anyone else has any other suggestions. Am using VS2005.
>> Thanks
>> Sanjeev
>>|||on a PDF it works perfectly ok, if you include as a background image.
Amarnath, MCTS
"Sanjeev Rampersad" wrote:
> Thanks. Its worth a shot.Will try it as a background.
> I just have to worry about exporting only to pdf..
> "Amarnath" <Amarnath@.discussions.microsoft.com> wrote in message
> news:853A1C5B-39F5-4EBF-BBD0-BA59F92D46D0@.microsoft.com...
> > You can put the image using image control, but not possible to edit. What
> > you
> > can do is to put the document images as background and align the textbox
> > exactly as a entry field just next to the fields which require a value.
> > This
> > way you can try, but not sure you may face some problem when you export to
> > different formats.
> >
> > Amarnath, MCTS
> >
> >
> > "Sanjeev Rampersad" wrote:
> >
> >>
> >> After scanning a document, can one load the resultant bitmap image into
> >> Reporting services and be able to edit it.
> >>
> >> eg. lets say a portion of the document was
> >>
> >> Name : _______________
> >> Surname : _______________
> >> ID No. : _______________
> >>
> >> Now where the underlined parts are, can one then go and edit it and Add a
> >> field from a dataset.
> >> The reason I ask is that I have several 20 odd page documents to create
> >> in
> >> reporting services.
> >> We want to automate the process whereby the users capture the neccasary
> >> data
> >> in our application and the report is generated from this.
> >> Now it may take forever doing this manually because will have to worry
> >> about
> >> whether each page fits properly,
> >> formatting and as the report gets larger the response times in Visual
> >> studio
> >> is horrendous.
> >> So I was just wondering if this were possible.
> >> Or if anyone else has any other suggestions. Am using VS2005.
> >>
> >> Thanks
> >> Sanjeev
> >>
> >>
> >>
>
>

Friday, March 9, 2012

List of options for the .ini file

I am looking for a resource online or a document that
lists all of the possible options that can be placed in
the setup.ini file. Does anyone possibly have this
information or know where I can find it?
Thank you very much!
3.4.3 MSDE 2000 Setup Parameters
MSDE 2000 is designed to be distributed with applications and installed
by the setup program of the application. The Desktop Engine Setup.exe
utility is usually called by an application setup utility, but can also
be run from a command prompt window. The MSDE 2000 setup utility does
not have a graphical user interface. Instead, this utility accepts a set
of switches and parameters that specify the actions the utility should
take.
You can only use MSDE 2000 Release A to install new instances of MSDE
2000. Do not use it to upgrade instances running earlier versions of
MSDE 2000. When running the MSDE 2000 Release A version of Desktop
Engine Setup.exe, do not use these switches or parameters: UPGRADE,
UPGRADEUSER, UPGRADEPWD, or /upgradesp. Use SQL Server 2000 SP3a to
upgrade existing instances of MSDE 2000 to MSDE 2000 SP3a. For more
information about upgrades, see 1.0 Introduction.
This readme only discusses the more commonly used Setup parameters and
switches. All of the switches and parameters supported by Desktop Engine
Setup.exe are documented in "Customizing Desktop Engine Setup.exe" in
SQL Server 2000 Books Online. The version of this topic that describes
the behavior of Desktop Engine Setup.exe included in MSDE 2000 Release A
is at this Microsoft Web page. For more information about setup
documentation, see 1.1 MSDE 2000 Documentation.
You must enclose the values for MSDE Setup parameters in double
quotation marks if the values specified have special characters, such as
blanks. Otherwise quotation marks are optional.
Most installations of MSDE 2000 Release A are made using only these
Setup parameters:
Parameter Description
SAPWD="AStrongPassword" Specifies a strong password to be assigned to
the sa administrator login.
INSTANCENAME="InstanceName" Specifies the name of the instance. If
INSTANCENAME is not specified, Setup installs a default instance.
Other parameters often used to tailor an installation are:
Parameter Description
DISABLENETWORKPROTOCOLS=n Specifies whether the instance will accept
network connections from applications running on other computers. By
default, or if you specify DISABLENTWORKPROTOCOL=1, Setup configures the
instance to not accept network connections. Specify
DISABLENETWORKPROTOCOLS=0 to enable network connections.
SECURITYMODE=SQL Specifies that the instance be installed in Mixed Mode,
where the instance supports both Windows Authentication and SQL
Authentication logins.
DATADIR="data_folder_path" Specifies the folder where Setup installs the
system databases, error logs, and installation scripts. The value
specified for data_folder_path must end with a backslash (\). For a
default instance, Setup appends MSSQL\ to the value specified. For a
named instance, Setup appends MSSQL$InstanceName\, where InstanceName is
the value specified with the INSTANCENAME parameter. Setup builds three
folders at the specified location: a Data folder, a Log folder, and a
Script folder.
TARGETDIR="executable_folder_path" Specifies the folder where Setup
installs the MSDE 2000 executable files. The value specified for
executable_folder_path must end with a backslash (\). For a default
instance, Setup appends MSSQL\Binn to the value specified. For a named
instance, Setup appends MSSQL$InstanceName\Binn, where InstanceName is
the value specified with the INSTANCENAME parameter.
When you use DISABLENETWORKPROTOCOLS=0 to enable network support for an
instance of MSDE 2000, applications connecting to the instance over a
network use Microsoft Data Access Components (MDAC). All versions of
Windows supported for use with MSDE 2000 include a version of the MDAC
software that works with MSDE 2000 Release A. For more information about
network communications, see this Microsoft Web page.
Using an .ini File
Desktop Engine Setup.exe parameters can be specified in two locations:
On the command prompt when running Setup.exe.
In an .ini file whose location is specified by a /settings switch. An
..ini file is a text file, such as a file created using Notepad, and
saved with a file name that has an extension of .ini. In the .ini file,
the first line is [Options], and then the parameters are specified, one
parameter per line.
Important If you use an .ini file during setup, avoid storing security
credentials in it.
This example specifies the parameters on the command prompt:
setup SAPWD="AStrongPassword" INSTANCENAME="InstanceName"
TARGETDIR="C:\MyInstanceFolder"
To run Setup with the same parameters using an .ini file, use Notepad to
create a file named MyParameters.ini with these contents:
[Options]
INSTANCENAME="InstanceName"
TARGETDIR="C:\MyInstanceFolder"
Then run Setup using the /settings switch to point to the .ini file:
setup /settings "MyParameters.ini" SAPWD="AStrongPassword"
Requesting a Setup Log
You will need a verbose log to verify that the installation succeeded or
to assist in debugging any problems that occur.
To generate a verbose log, specify /L*v <LogFileName>. <LogFileName> is
the name of a log file where Setup will record all of its actions. If
you do not specify a path as part of the name, the log file is created
in the current folder. If you are executing Setup from a compact disc,
you must specify the full path to a folder on the hard disk of your
computer.
This example creates a log file, MSDELog.log, in the root folder of the
C: drive:
setup SAPWD="AStrongSAPassword" /L*v C:/MSDELog.log
If installation succeeds, an entry similar to the following will be at
the end of the log:
=== Logging stopped: 5/16/03 0:06:10 ===
MSI (s) (BC:7C): Product: Microsoft SQL Server Desktop Engine --
Installation operation completed successfully.
If the installation does not succeed, an entry similar to the following
will be at the end of the log:
=== Logging stopped: 5/15/03 23:50:34 ===
MSI (c) (6A:CE): Product: Microsoft SQL Server Desktop Engine --
Installation operation failed.
If the installation failed, search for the string "value 3" in the error
log. Within 10 lines of the string will be a failure notice for a custom
action. The notice will have additional information about the nature of
the failure.
[Top]
--Original Message--
From: Scott [mailto:sts@.weiland-wfg.com]
Posted At: Wednesday, 19 January 2005 8:19 AM
Posted To: microsoft.public.sqlserver.msde
Conversation: List of options for the .ini file
Subject: List of options for the .ini file
I am looking for a resource online or a document that lists all of the
possible options that can be placed in the setup.ini file. Does anyone
possibly have this information or know where I can find it?
Thank you very much!
|||Have a look at this topic in the copy of the SQL Server 2000 Books Online
published in the MSDN Library.
http://msdn.microsoft.com/library/?u...asp?frame=true
You can also download a local copy of the SQL Server 2000 Books Online from:
http://www.microsoft.com/sql/techinf...2000/books.asp
Alan Brewer [MSFT]
Content Architect
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

Friday, February 24, 2012

list existing replication's settings

Hi experts,
I wish to document the replication settings on our
environment, is there a good way to list the settings on
the system ?
regards,
Diana.
Diana,
there are loads of sps to help with documentation:
sp_helpdistpublisher
sp_helpdistributor
sp_helppublication
sp_helpsubscription
to name but a few. Many of them take parameters, so you can't run them
without first configuring.
I personally do things in a less sophisticated way - I right-click the
replication folder and select "Generate SQL script..." which is then placed
in Sourcesafe.
You could also do this in SQLDMO, but IMO the simplest and quickest way
would be to have EM create the script as above.
HTH,
Paul Ibison
|||sp_helppublication provides much of the information you are looking for.
I also find it helpful to script out my replication jobs. Here is an example
of such a script.
set objServer=CreateObject("SQLDMO.SQLServer")
objServer.LoginSecure=True
objServer.Connect "Publisher"
objServer.Replication.Script 1024,"c:\sqlout.sql"
set objServer=Nothing
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Diana" <yuendiana@.sinaman.com> wrote in message
news:261301c47dfb$d68d8a40$a301280a@.phx.gbl...
> Hi experts,
> I wish to document the replication settings on our
> environment, is there a good way to list the settings on
> the system ?
> regards,
> Diana.