Let's look at sample data in the tables:
3> select * from a
4> go
id atr1 atr2 loan
----------- ----------- ----------- ----
1 1 1
2 3 3
(2 rows affected)
1> select * from b
2> go
id atr1b...
Hello,
I assume that table A has some id, so lets take example table A:
create table A (
id int not null,
atr1 int,
atr2 int,
loan char
)
go
now let's have some table B
create table B (
id int not null,
atr1b int,
atr2b int,
)
go
Now you can write SP for comparing desired...
the same problem can occur if table has '-' or space inside name. This syntax always works (if names does not contain any characters that are not allowed)
[data base name].[owner name].[table name]
alternatively you can change [ ... ] with ' ... ' notation
Chris
... in fact only definition of the tdist counts and stored procedure ... the rest is just copy from my notepad - sorry :).
For each row in tdist you have int_c which says how many columns are populated
Chris
Hello,
this is simple and 'dirty' solution for your problem using stored procedure instead of insert into denormalized table ... maybe it will help
best regards
Chris
create table t (
id varchar(10),
a int
)
go
insert into t values('A',1)
insert into t values('A',2)
insert into t...
GDM8,
i've heard that Defragmentation of NTFS included in Windows 2k is very poor - If you run the third party tool on the "defragmented" disk it still has a lot of work to do - maybe that's an issue here
best regards
Chris
I did somethig like this
> create procedure ttt
> @a int,
> @b bit
>as
>begin
>
> create table #t (
> idd int
> )
>
> if @b=1
> print "test1"
> else
> print "test2"
>end
and it works like this
> exec ttt 1,1
gives test1
> exec ttt 1,2
gives test2
I think you...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.