Showing posts with label sql-server. Show all posts
Showing posts with label sql-server. Show all posts

Friday, March 30, 2012

How can i Replace the Minus-Statement

Hi,

I've to translate this SQL-Statement from ORACLE to SQL-Server. But I'm missing the Minus-Statement on SQL-Server.

select table_name, column_name from user_tab_columns
where table_name not in ( select table_name from user_tab_columns
minus
select tab_name from data_dic
)
minus
select tab_name, col_name from data_dic

what can I do to run it on SQL-Server.

Thanks in advance

Raimund

use whidbey's intersect function|||

Hi you didn′t specify wheter you are using 2k5 or 2k. In SQL Server you would use EXCEPT

select table_name, column_name from user_tab_columns
where table_name not in ( select table_name from user_tab_columns
EXCEPT
select tab_name from data_dic
)
EXCEPT
select tab_name, col_name from data_dic

in 2k, you would use NOT IN, like you did in the above query:


select table_name, column_name from user_tab_columns
where table_name not in ( select table_name from user_tab_columns
WHERE table_name NOT IN
(
select tab_name from data_dic
)
)
WHERE table_name NOT IN
(
select tab_name, col_name from data_dic
)


HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

Thanks it works fine.

I already had it before but it didn't work. Probably there was something wrong in the Syntax.

Best Regards

Raimund

How can i remove a server from enterprise manager

Hello,
SQL-Server 2000:
how can I remove server registrations from enterprise manager, when
the servers are no more available?
For example there are several registrations from servers running under
a virtual pc (for developer purposes). Others are there from remote
support sessions. I'm not able to get in the context menu of that
servers.
Can you please help me?
Thanks Alfred
I found this to be possible.
Using the mouse, if one "right clicks" on the server registration and waits
for what seems like an age, the menu appears allowing one to delete the
registration. Don't left-click first!
|||"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.c om...
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
Does right-click, Delete SQL Server Registration not work?
Kind Regards, Howard
|||try attached vbscript uses DMO to delete the server registration - rename to
..vbs and run on the server with registration u want to delete byusing
CSCRIPT DELSQLRegistration.vbs
"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.c om...
> Hello,
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
> For example there are several registrations from servers running under
> a virtual pc (for developer purposes). Others are there from remote
> support sessions. I'm not able to get in the context menu of that
> servers.
> Can you please help me?
> Thanks Alfred
|||(sorry fat fingers)
try attached vbscript uses DMO to delete the server registration - rename to
..vbs and run on the server with registration u want to delete by using :
CSCRIPT DELSQLRegistration.vbs SERVER
where SERVER is the name of the server Registration you want to delete
Note for it to no longer appear in Enterprise Manager , you need to restart
Enterprise Manager.
Andy.
"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.c om...
> Hello,
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
> For example there are several registrations from servers running under
> a virtual pc (for developer purposes). Others are there from remote
> support sessions. I'm not able to get in the context menu of that
> servers.
> Can you please help me?
> Thanks Alfred
|||man forgot attachment - bad day ..
"Andy Ball" <andy.ball@.remove4spam_greenfell.com> wrote in message
news:%23bs6bC4jEHA.1356@.TK2MSFTNGP09.phx.gbl...
> (sorry fat fingers)
> try attached vbscript uses DMO to delete the server registration - rename
to
> .vbs and run on the server with registration u want to delete by using :
> CSCRIPT DELSQLRegistration.vbs SERVER
> where SERVER is the name of the server Registration you want to delete
> Note for it to no longer appear in Enterprise Manager , you need to
restart
> Enterprise Manager.
> Andy.
> "Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
> news:8d338431.0408310515.7ae1d9d6@.posting.google.c om...
>
begin 666 DelSQLRegistration.txt
M)R J*BH@.1&5L4U%,4F5G:7-T<F%T:6]N+G9B<R J*BH-"B<@.=7-I;F<@.1$U/
M(%-C<FEP="!O=70@.<F]L;"!T:')O=6=H(%-E<G9E<G,@.4F5G:7-T97)E9"!I
M;B!%;G1E<G!R:7-E($UA;F%G97(@.#0HG(&%N9"!T<GD@.86YD(&1E;&5T90T*
M)R!0<F5S=6UE(%-!($%C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96YT4V5R=F5R1W)O=7 N4F5G:7-T97)E
M9%-E<G9E<G,-"@.D)1F]R($5A8V@.@.4F5G:7-T97)E9%-E<G9E<B!I;B!O4F5G
M:7-T97)E9%-E<G9E<G,-"@.D)"5=38W)I<'0N16-H;R!V8E1!0B K(")397)V
M97(@./2 B("L@.4F5G:7-T97)E9%-E<G9E<BY.86UE#0H)"0D-"@.D)"2<@.*BHJ
M(%-E<G9E<B!&;W5N9"!H97)E("HJ*B -"@.D)"4EF(%5#05-%*%)E9VES=&5R
M961397)V97(N3F%M92D@./2!50T%312A397)V97).86UE*2!4:&5N#0H)"0D)
M5W-C<FEP="Y%8VAO('9B5$%"("L@.54-!4T4H4V5R=F5R3F%M92D@.*R B(&ES
M(')E9VES=&5R960N($1E;&5T:6YG(@.T*"0D)"5)E9VES=&5R9 61397)V97(N
M4F5M;W9E#0H)"0D)8E-E<G9E<D9O=6YD(#T@.,0T*"0D)"2<@.2&%V92!T;R!Q
M=6ET(&-O<R!R96-U<G-I=F4@.<W5B+"!%;F0@.4W5B('=O;B=T(&-U="!I= T*
M"0D)"5=S8W)I<'0N475I=" -"@.D)"45N9"!)9B -"@.D)3F5X= T*#0H)"2<@.
M:64@.=V4@.:&%V92!397)V97)'<F]U<',@.8F5L;W<@.=&AI<R!O;F4L('-O(')E
M8W5R<VEV96QY(&-A;&P@.=&AE(%-U8B!A9V%I;B!W:71H('1H92!C=7)R96YT
M(%-E<G9E<@.T*"0DG($=R;W5P(&%S('1H92!2;V]T3V)J96-T"0T*"0E)9B!O
M0W5R<F5N=%-E<G9E<D=R;W5P+E-E<G9E<D=R;W5P<RY#;W5N=" ^(# @.5&AE
M;B -"@.D)"4-A;&P@.1&5L4U%,4F5G:7-T<F%T:6]N("A397)V97).86UE+"!O
M0W5R<F5N=%-E<G9E<D=R;W5P*0T*"0E%;F0@.268@.#0H)3F5X= T*16YD(%-U
%8@.T*#0H`
`
end

How can i remove a server from enterprise manager

Hello,
SQL-Server 2000:
how can I remove server registrations from enterprise manager, when
the servers are no more available?
For example there are several registrations from servers running under
a virtual pc (for developer purposes). Others are there from remote
support sessions. I'm not able to get in the context menu of that
servers.
Can you please help me?
Thanks AlfredI found this to be possible.
Using the mouse, if one "right clicks" on the server registration and waits
for what seems like an age, the menu appears allowing one to delete the
registration. Don't left-click first!|||"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.com...
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
Does right-click, Delete SQL Server Registration not work?
Kind Regards, Howard|||try attached vbscript uses DMO to delete the server registration - rename to
.vbs and run on the server with registration u want to delete byusing
CSCRIPT DELSQLRegistration.vbs
"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.com...
> Hello,
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
> For example there are several registrations from servers running under
> a virtual pc (for developer purposes). Others are there from remote
> support sessions. I'm not able to get in the context menu of that
> servers.
> Can you please help me?
> Thanks Alfred|||(sorry fat fingers)
try attached vbscript uses DMO to delete the server registration - rename to
.vbs and run on the server with registration u want to delete by using :
CSCRIPT DELSQLRegistration.vbs SERVER
where SERVER is the name of the server Registration you want to delete
Note for it to no longer appear in Enterprise Manager , you need to restart
Enterprise Manager.
Andy.
"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.com...
> Hello,
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
> For example there are several registrations from servers running under
> a virtual pc (for developer purposes). Others are there from remote
> support sessions. I'm not able to get in the context menu of that
> servers.
> Can you please help me?
> Thanks Alfred

How can i remove a server from enterprise manager

Hello,
SQL-Server 2000:
how can I remove server registrations from enterprise manager, when
the servers are no more available?
For example there are several registrations from servers running under
a virtual pc (for developer purposes). Others are there from remote
support sessions. I'm not able to get in the context menu of that
servers.
Can you please help me?
Thanks AlfredI found this to be possible.
Using the mouse, if one "right clicks" on the server registration and waits
for what seems like an age, the menu appears allowing one to delete the
registration. Don't left-click first!|||"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.com...
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
Does right-click, Delete SQL Server Registration not work?
Kind Regards, Howard|||try attached vbscript uses DMO to delete the server registration - rename to
.vbs and run on the server with registration u want to delete byusing
CSCRIPT DELSQLRegistration.vbs
"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.com...
> Hello,
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
> For example there are several registrations from servers running under
> a virtual pc (for developer purposes). Others are there from remote
> support sessions. I'm not able to get in the context menu of that
> servers.
> Can you please help me?
> Thanks Alfred|||(sorry fat fingers)
try attached vbscript uses DMO to delete the server registration - rename to
.vbs and run on the server with registration u want to delete by using :
CSCRIPT DELSQLRegistration.vbs SERVER
where SERVER is the name of the server Registration you want to delete
Note for it to no longer appear in Enterprise Manager , you need to restart
Enterprise Manager.
Andy.
"Alfred Sehmueller" <alfred.sehmueller@.gmx.de> wrote in message
news:8d338431.0408310515.7ae1d9d6@.posting.google.com...
> Hello,
> SQL-Server 2000:
> how can I remove server registrations from enterprise manager, when
> the servers are no more available?
> For example there are several registrations from servers running under
> a virtual pc (for developer purposes). Others are there from remote
> support sessions. I'm not able to get in the context menu of that
> servers.
> Can you please help me?
> Thanks Alfredsql