Showing posts with label scenario. Show all posts
Showing posts with label scenario. Show all posts

Friday, March 30, 2012

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

[:'(]

Monday, March 12, 2012

Pull replication setup problem

Hi,
I am changing the scenario of our replication from Push to Pull, but I could
not set up the Pull replication.
The publisher and distributor are on the same machine.
The subscriber always gets an error message as
"The process could not read file
"E:\repl\unc\MyServer_MyDB\200508\tableone.sch " due to OS error 3.
I searched a lot on the google, but no one seems fit my problem.
I am using SQL Server 2000 on both the Publisher and Subscriber.
Thanks for any help
Frank
Frank,
can you log on to the subscriber using the sql server agent's login and see
if you can read the snapshot share?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Friday, March 9, 2012

Pull from the DMZ?

Ok, so in my scenario, if I have a one way trust & am already replicating to the DMZ, I should be able to setup a publication on the DMZ & pull, right?
Yes, I have done this. I think you will need to make the publication on the
server in the DMZ anonymous, so you don't have to register the subscriber on
the DMZ Publisher.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"JLS" <jlshoop@.hotmail.com> wrote in message
news:%237vu$Du7FHA.1032@.TK2MSFTNGP11.phx.gbl...
Ok, so in my scenario, if I have a one way trust & am already replicating to
the DMZ, I should be able to setup a publication on the DMZ & pull, right?
|||Oh thanx for adding the bit about making the DMZ publication anonymous, you may have actually saved the last strand of hair on my head from being ripped out!!!!
Jude
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:%23NQwMFu7FHA.2040@.TK2MSFTNGP14.phx.gbl...
Yes, I have done this. I think you will need to make the publication on the
server in the DMZ anonymous, so you don't have to register the subscriber on
the DMZ Publisher.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"JLS" <jlshoop@.hotmail.com> wrote in message
news:%237vu$Du7FHA.1032@.TK2MSFTNGP11.phx.gbl...
Ok, so in my scenario, if I have a one way trust & am already replicating to
the DMZ, I should be able to setup a publication on the DMZ & pull, right?

Pull data from different database server

Hi,

In my application i am storing the data in a database(server A). And i have a scenario where in a middle server(server B) is there in which i need to create a table and pull the data from one of the tables from my original database server(server A) into second database server(server B). Where can i get the code to write a job script which can connect from server B to server A and pull the data from the table and delete that data from the table in server A. Can any give me the code or link where i can find the code. Please help.

Thanks

If they are SQL Server databases you can create a DTS job to copy the tables and data. Or within you SQL, you can reference the other SQL server from the following

SELECT *FROM <serverName>.<ownerName>.<table>
Where the serverName is the other server, ownerName is the owner of the table you want to access.|||

There are 2 ways of doing this.

1) You can use Linked Server.

2) Use DTS or SSIS Packages to transfer data from one server and database to another.

Hope this will help.

|||

Hi,

Could you please tell me what are the steps i need to follow in order to pull the data by using Linker Server option. or else any site which has step by step details to work with linker server and pull the data.

Thanks

|||

If i user linked server and write a stored procedure to do my job, how can i schedule the script to work for every 5 min's. I want to pull pull the data for every 5 mins. Can i close the connection every time when i finish my job and reconnect again after 5 min's when i want to pull the data again. Please help

Thanks

|||

tgopi99:

If i user linked server and write a stored procedure to do my job, how can i schedule the script to work for every 5 min's. I want to pull pull the data for every 5 mins. Can i close the connection every time when i finish my job and reconnect again after 5 min's when i want to pull the data again.

You can schedule the SP to run at a regular interval using SQL Jobs. One more thing, if you use any of the features like Jobs or DTS or SSIS, they themselves manage the connections to the server and you don't need to worry about them.

Well, linked server is one of the options. Below is a link which can be useful for linked servers:

http://msdn.microsoft.com/msdnmag/issues/04/11/DataPoints/

But there is another way around, that is to create a DTS ( if you are using SQL Server 2000 ) or SSIS ( if you are using SQL Server 2005 ) package. If your purpose is to transfer data between 2 servers then you can achieve this by writing a DTS or SSIS.

Below are some links for creating and using DTS:

http://www.databasejournal.com/features/mssql/article.php/3579941

http://www.verio.com/support/documents/view_article.cfm?doc_id=3846

Below are some links for creating and using SSIS:

http://msdn2.microsoft.com/en-us/library/ms167031.aspx

http://aspalliance.com/947_Building_a_SQL_Server_2005_Integration_Services_Package_Using_Visual_Studio_2005

http://www.databasejournal.com/features/mssql/article.php/3503996

Hope the links are sufficient and helpful.

Saturday, February 25, 2012

Publish scenario - how can this work?

Our current setup has a hand held device, a laptop and head office. The
field reps have the hand held and laptop and need to get and send data back
to head office. Merge Replication seems to be the answer and I was thinking
that the Head Office would publish to the Laptop and the Laptop would then
publish to the Hand Held. But SQL Server 2005 Express can only be a
Subscriber and not a Publisher.
The reason to do this is that only certain rows will be published to the
laptop (say 1 weeks work) and then only certain rows (say 1 or 2 days work)
will be published to the hand held.
Is there a way to accomplish this?
Here's how it breaks down:
Head Office = SQL Server 2005 Standard Edition
Laptop = SQL Server 2005 Express Edition
Hand Held = SQL Server 2005 Compact Edition
Thanks,
Richard.
You might want to look at RDA as the transit mechanism between Express and
the HandHelds.
Otherwise I would replicate from the Standard Edition publisher to the
handhelds.
http://www.zetainteractive.com - Shift Happens!
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Richard Wodabek" <rwodabek@.cogeco.ca> wrote in message
news:uocMysrNIHA.2268@.TK2MSFTNGP02.phx.gbl...
> Our current setup has a hand held device, a laptop and head office. The
> field reps have the hand held and laptop and need to get and send data
> back
> to head office. Merge Replication seems to be the answer and I was
> thinking
> that the Head Office would publish to the Laptop and the Laptop would then
> publish to the Hand Held. But SQL Server 2005 Express can only be a
> Subscriber and not a Publisher.
> The reason to do this is that only certain rows will be published to the
> laptop (say 1 weeks work) and then only certain rows (say 1 or 2 days
> work)
> will be published to the hand held.
> Is there a way to accomplish this?
> Here's how it breaks down:
> Head Office = SQL Server 2005 Standard Edition
> Laptop = SQL Server 2005 Express Edition
> Hand Held = SQL Server 2005 Compact Edition
> Thanks,
> Richard.
>
|||Thanks Hilary, RDA might work for us.
Any chance 2008 Express Edition will allow Publishing?
Richard.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uNmcUmzNIHA.292@.TK2MSFTNGP02.phx.gbl...[vbcol=seagreen]
> You might want to look at RDA as the transit mechanism between Express and
> the HandHelds.
> Otherwise I would replicate from the Standard Edition publisher to the
> handhelds.
> --
> http://www.zetainteractive.com - Shift Happens!
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Richard Wodabek" <rwodabek@.cogeco.ca> wrote in message
> news:uocMysrNIHA.2268@.TK2MSFTNGP02.phx.gbl...
then
>