looks like the first issue is that you haven't actually @t1 as a table before you try to use it as one. here's a quick demo of using a table variable.
declare @t1 table(
pkT1 int identity,
t1Stuph varchar(50)
)
insert into @t1(t1Stuph) values('This is a test. It is only a test')
select *...
to find a duplicate record do a group by with a having clause. like this:
select colA, colB, count(*)
from table
group by colA
having count(*) > 1
where colA, colB is the list of columns that need to be distinct. if you have an identity column, you can then delete the records from the...
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.