It is currently 7 June 2025, 15:35 Advanced search

INSERT SELECT su SQL SERVER named instance

Domande e risposte su come utilizzare Instant Developer Foundation al meglio

INSERT SELECT su SQL SERVER named instance

Postby bugfree » 28 January 2011, 9:02

ciao

ho una applicazione di prova che si connette a due database ospitati da due istanza (named) SQL SERVER (server1\inde e server2\inde)
Nell'applicazione voglio inserire una query di tipo INSERT INTO ... SELECT ...

a runtime ottengo un errore di query malformata

nella informazioni di debug trovo che è aperta la connessione al database che contiene la tabella da cui effettuo la select (orders)

Code: Select all
160 - P2000pro: Open Connection
Connection String = Data Source=server2\inde;Initial Catalog=test_inde;Persist Security Info=False
User ID = sa
Password = ....


e poi l'errore (uso dello \ per separare server da istanza sulla seconda tabella)

Code: Select all
Ordine.Copia Ordine
Weborder (INDE1): Insert into... select
insert into server1\inde.INDE1..WEBORDER (   wot_cli_num,   wot_status,   wot_date ) select   1,   2,   GETDATE() from   orders A where (A.oct_num_ord = 2)
(CATCH) Err : Sintassi non corretta in prossimità di '\'.


dove sto sbagliando?
(i due database server sono necessari, ovviamente, così come il fatto che si usino delle istanze nominali)

grazie mille
stefano
bugfree
 
Posts: 28
Joined: 11 January 2011, 14:32

Re: INSERT SELECT su SQL SERVER named instance

Postby g.lanzi » 15 February 2011, 13:47

Allo stato attuale non è possibile effettuare una INSERT SELECT tra due server diversi, è supportato l'uso di due tabella di due istanze diverse dello stesso server.
Giuseppe Lanzi
Director of Support services
Pro Gamma S.p.A.
User avatar
g.lanzi
Pro Gamma
Pro Gamma
 
Posts: 3504
Joined: 29 September 2010, 10:24
Location: Bologna

Re: INSERT SELECT su SQL SERVER named instance

Postby bugfree » 15 February 2011, 13:49

ok, grazie mille
bugfree
 
Posts: 28
Joined: 11 January 2011, 14:32


Return to Tips & Tricks - Foundation

Who is online

Users browsing this forum: Google [Bot] and 56 guests

cron