Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Friday, March 30, 2012

Puzzled by Config files

I created a package, created an XML Config file, created a deployment utility and then deployed to server. I scheduled it with agent and I get this error (changed the package name in the error to IMPORT to make it more readable):

Description: The configuration file name "C:\Documents and Settings\chris\My Documents\Visual Studio 2005\Projects\IMPORT\IMPORT\IMPORT.dtsConfig" is not valid. Check the configuration file name. End Warning Warning: 2006-07-12 13:11:39.96 Code: 0x80012059 Source: IMPORT Description: Failed to load at least one of the configuration entries for the package. Check configurations entries and previous warnings to see descriptions of which configuration failed. End Warning Progress: 2006-07-12 13:11:40.56 Source: Import Data Validating: 0% complete End Progress Progress: 2006-07-12 13:11:40.56 Source:... Process Exit Code 1. The step failed.

So basically its trying to point to a config file on my dev workstation. When I created the deploy utility it created a config file in the Deployment directory with the Manifest and the package. I installed from the deployment directory. When installing it asked where I wanted to install and I left it the default of "C:\Program Files\Microsoft SQL Server\90\DTS\Packages\IMPORT" and if I look in that folder the IMPORT.dtsconfig is there.

Ideas of where I went wrong? I want to make sure I understand the whole configuration file notion correctly as I am starting to roll a bunch of packages with config files out to production. I've done the tutorial and thought it was straightforward and made sense. I can fix it by editing the xml of the package and removing the line pointing to my dev box - just want to know what I am doing wrong :)

Nevermind... Found lots of other people with similar issues in diff threads on this forum. This whole config file thing is pretty confusing. When you do the install from the deployment folder it will show all the values from the config file in the deployment directory - but it doesn't use any of them when you actually run the package.

I am really not sure why they put the dtsconfig file in the deployment folder at all - all that does is confuse things. I had been placing the production config file over the one in the deployment folder and assumed it would use it... not so.

putting multiple xml files data into database in a single transaction

Super AngryFirst of all i do not know whether this is the right form to ask the question

Let me describe the scenario iam using

Iam generating xml files at a particular place and sending them to a server

xml1|------->dataset1---------->adapter1.update(dataset1)

xml2|-------->dataset2---------->adapter2.update(dataset2)

xml3|-------->dataset3---------->adapter3.update(dataset3)

all thethree updates should happen in onlyone transaction if any one of the update fails then the transaction should rollback

can anyone tell me a way to do it

i am desperately in search of any ways to do it can anybody help pleaseSad

If the 3 SqlDataAdapters are using the same connection, maybe you can try to embed the updates in a single transaction opened on the connection:

using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString()))
{

conn.open;

//build your SqlDataAdapters on the same conneciton

SqlTransaction st;
st=conn.BeginTransaction("tran1");
adapter1.update(dataset1);

adapter2.update(dataset2);

adapter3.update(dataset3);

st.Commit();
}

|||

ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized

This is the error iam getting bcoz iam using the command builder to update the table using dataset cant we use command builder and transaction at the same time

or we should use only sqlcommand to the method

can anybody tell me the solution cant we use transaction and adapter and commandbuilder at the same time

[:'(]

Wednesday, March 28, 2012

Putting attribute on root node using FOR XML PATH

I would like to know how to put an attribute on the root node of the
xml returned from a FOR XML PATH query. One thing I tried is this:

select
m.msgid '@.msgID',
st.namelong 'set/@.namelong',
st.nameshort 'set/@.nameshort',
from
msgset m
inner join settable st on (st.setid = m.setid)
where m.msgID = 195
for xml path('set'), root('message')

but it gives me:

<message>
<set msgID="195">
<set namelong="STUFF HERE" nameshort="STUFF" />
</set>
<set msgID="195">
<set namelong="MORE STUFF" nameshort="M STUFF" />
</set>
<set msgID="195">
<set namelong="TESTING 123" nameshort="TEST" />
</set>
</message
here is what I want:

<message msgID="195">
<set namelong="STUFF HERE" nameshort="STUFF" />
<set namelong="MORE STUFF" nameshort="M STUFF" />
<set namelong="TESTING 123" nameshort="TEST" />
</message
I can't get it. If I use: root(''), then it tells me: "Row tag
omission (empty row tag name) cannot be used with attribute-centric FOR
XML serialization." I'm sure there is a trick to this-- any
suggestions?

Many thanks.
the chippsterTry using a nested query instead

select
m.msgid '@.msgID',
(
select st.namelong '@.namelong',
st.nameshort '@.nameshort'
from settable st
where st.setid = m.setid
for xml path('set'),type)
from
msgset m
where m.msgID = 195
for xml path('message'), type|||Thank you for your suggestion. However, running your query gives me
this:

<message msgID="195">
<set namelong="STUFF HERE" nameshort="STUFF" />
</message>
<message msgID="195">
<set namelong="MORE STUFF" nameshort="M STUFF" />
</message>
<message msgID="195">
<set namelong="TESTING 123" nameshort="TEST" />
</message
Thanks|||Can you post your DDL and sample data.

Here what I used based on your narrative which
gives the results you wanted

declare @.settable table(msgid int,namelong varchar(20),nameshort
varchar(10),setid int)
insert @.settable(msgid,namelong,nameshort,setid) values(195,'STUFF
HERE','STUFF',1)
insert @.settable(msgid,namelong,nameshort,setid) values(195,'MORE
HERE','M STUFF',1)
insert @.settable(msgid,namelong,nameshort,setid) values(195,'TESTING
123','TEST',1)
declare @.msgset table(msgid int,setid int)
insert into @.msgset(msgid,setid) values(195,1)

select
m.msgid '@.msgID',
(
select st.namelong '@.namelong',
st.nameshort '@.nameshort'
from @.settable st
where st.setid = m.setid
for xml path('set'),type)
from
@.msgset m
where m.msgID = 195
for xml path('message'), type|||Thanks again for your reply. I think the problem here is that the
relationship between the msgset table and the settable is many-to-many.
So, the sample data would look like this:

declare @.settable table(msgid int,namelong varchar(20),nameshort
varchar(10),setid int)
insert @.settable(msgid,namelong,nameshort,setid) values(195,'STUFF
HERE','STUFF',1)
insert @.settable(msgid,namelong,nameshort,setid) values(195,'MORE
HERE','M STUFF',2)
insert @.settable(msgid,namelong,nameshort,setid) values(195,'TESTING
123','TEST',3)
declare @.msgset table(msgid int,setid int)
insert into @.msgset(msgid,setid) values(195,1)
insert into @.msgset(msgid,setid) values(195,2)
insert into @.msgset(msgid,setid) values(195,3)

This is an important detail, I'm sorry I left it out.

Any help would be much appreciated-- it seems like there should be a
simple solution to this.
Thanks.|||OK, I figured out a solution:

select
m.msgid '@.msgID',
(
select st.namelong '@.namelong',
st.nameshort '@.nameshort'
from settable st, msgset ms
where st.setid = ms.setid
and ms.msgid = 195
for xml path('set'),type)
from
message m
where m.msgID = 195
for xml path('message'), type

I joined another table that created a one-to-many against the msgset
table. That seems to keep the root node down to one. Thanks for
pointing me in the right direction.

--chip

Monday, February 20, 2012

PSSDiag Failed to instantiate an XML DOM

Can anyone explain to me what I need to do to correct this?

I have ran the SAME PSSDiag install from the this particular server MANY times before.

All of a sudden, it now fails to start and I find this error, that is posted in teh subject line of the thread, in teh Windows Application Event Log.

If I need to install another app in order to correct this, please let me know if the installed app will need a reboot of the server to take affect. I have to schedule down time for that.

Thanks ALL!

Check with this
http://www.microsoft.com/downloads/details.aspx?familyid=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&displaylang=en

PSSDiag Failed to instantiate an XML DOM

Can anyone explain to me what I need to do to correct this?

I have ran the SAME PSSDiag install from the this particular server MANY times before.

All of a sudden, it now fails to start and I find this error, that is posted in teh subject line of the thread, in teh Windows Application Event Log.

If I need to install another app in order to correct this, please let me know if the installed app will need a reboot of the server to take affect. I have to schedule down time for that.

Thanks ALL!

Check with this
http://www.microsoft.com/downloads/details.aspx?familyid=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&displaylang=en