Showing posts with label separated. Show all posts
Showing posts with label separated. Show all posts

Thursday, March 29, 2012

data synchronisation

Hi,

I'm working with two databases on to physicaly separated servers: #1
is on a local machine en I can only connect to #2 via an ADSL
connection.
I need to syncrhonise the data. This works fine via the wizard from
the Enterprise Manager. But I want to get this done via a script form
the Query Analyzer that I can run whenever I want to. Something like:

insert into srv1.database.dbo.table1
select * from srv2.database.dbo.table1

When I do this I get an error about "linked servers". That surprises
me, because I have no linked servers configured and yet the wizard
works fine?

Can anyone tell me how to accomplish this?

tav
Jan Willemsjhmwillems@.hotmail.com (Jan) wrote in message news:<240176c1.0404060206.4bfaaca3@.posting.google.com>...
> Hi,
> I'm working with two databases on to physicaly separated servers: #1
> is on a local machine en I can only connect to #2 via an ADSL
> connection.
> I need to syncrhonise the data. This works fine via the wizard from
> the Enterprise Manager. But I want to get this done via a script form
> the Query Analyzer that I can run whenever I want to. Something like:
> insert into srv1.database.dbo.table1
> select * from srv2.database.dbo.table1
> When I do this I get an error about "linked servers". That surprises
> me, because I have no linked servers configured and yet the wizard
> works fine?
> Can anyone tell me how to accomplish this?
> tav
> Jan Willems

The Import/Export Data wizard uses a separate connection to each
server, so linked servers are not involved. The INSERT statement above
does require the linked servers to exist, however.

So you could just create the linked servers you need, or if that's not
possible for some reason, then you can save a DTS package from the
wizard, and execute it in whatever way is most convenient:

http://www.sqldts.com/default.aspx?104

Simon

Sunday, March 25, 2012

Data set towards a chain of character

Hello :

I have a request which me dismissal 10 lines (normal select), I want to have quite lines in a single chain of character, separated one in the others by a comma:

A
B
C
D > A,B,C,D

What is that you have an idea for ca.

Thank you.

If you use SQL Server 2005,

Code Snippet

Declare @.data table (val char);

Insert Into @.data

Select 'A'

Union All

Select 'B'

Union All

Select 'C'

Union All

Select 'D'

Select

Substring((Select ',' + val as [text()] from @.data for xml path('')),2,8000)

|||Thank's , but i use oracle !!!

|||

Oracle?

Ok, I believe except SQL Server none of the DB provide such a easy way to covert the result-set into XML (For XML clause). But oracle do have the xml output – you can try to get the answer on oracle forums. But I can provide few hints (what I remember still), XMLElement, XMLAttributes, XMLForest these are the XML generator functions in Oracle.