hallo erstmal folgendes problem besteht immer noch ich muss eine spalte aus einer tabelle kopieren und in eine andere tabelle kopieren (verknüpfen) diese tabelle liegt natürlich nicht auf dem selben server !!!!
das skript sieht ungefähr so aus
#!/bin /sh
server1=xxx
user1=xxx
pw=xxx
server2=xxx
user2=xxx
pw2=xxx
echo"temporäre tabelle auf server1 anlegen"
sqsh w-2000 -S$server1 -U$user1 -P$pw <<END>"$dir_daten$datei"
use sever1
go
set nocount on
go
create table #temp_E1_p
(
E1 char(6) null,
fx char(6) null
)
go
insert into #temp_E1_p
select
E1=substring(a.bemerkung,charindex("(",a.bemerkung )+1,1),
fx= "f" +b.ne_typ+b.ne_code
from fv_mass a,fv_funkel b,fv_termine c
where a.id_funkel=b.id_funkel
and a.id_mass=c.id_mass
and a.kategorie like"E1_Extension"
and c.Ist_tch_in_Sv=null
\bcp -S$server2 -U$user2 -P$pw2 server2..(???)
go
END
echo "ausgabefile:"
sqsh -w2000 -S$server2 -U$user2 -P$pw2<<END>"$dir_daten$datei"
use server2
select * from #temp_E1_p
go
end
echo"ausgabefile
exit"
das skript sieht ungefähr so aus
#!/bin /sh
server1=xxx
user1=xxx
pw=xxx
server2=xxx
user2=xxx
pw2=xxx
echo"temporäre tabelle auf server1 anlegen"
sqsh w-2000 -S$server1 -U$user1 -P$pw <<END>"$dir_daten$datei"
use sever1
go
set nocount on
go
create table #temp_E1_p
(
E1 char(6) null,
fx char(6) null
)
go
insert into #temp_E1_p
select
E1=substring(a.bemerkung,charindex("(",a.bemerkung )+1,1),
fx= "f" +b.ne_typ+b.ne_code
from fv_mass a,fv_funkel b,fv_termine c
where a.id_funkel=b.id_funkel
and a.id_mass=c.id_mass
and a.kategorie like"E1_Extension"
and c.Ist_tch_in_Sv=null
\bcp -S$server2 -U$user2 -P$pw2 server2..(???)
go
END
echo "ausgabefile:"
sqsh -w2000 -S$server2 -U$user2 -P$pw2<<END>"$dir_daten$datei"
use server2
select * from #temp_E1_p
go
end
echo"ausgabefile
exit"