if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblProducts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblProducts]
GO
CREATE TABLE [dbo].[tblProducts] (
[intIFPWhsProductsID] [int] IDENTITY (1, 1) NOT NULL ,
[sinPeriodID] [smallint] NOT NULL ,
[sinWhsCodeID] [smallint] NOT NULL ,
[strWhsProdCode] [char] (20) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[strDesc] [varchar] (100) COLLATE Modern_Spanish_CI_AS NULL
) ON [PRIMARY]
GO
insert into tblProducts(sinPeriodId,sinWhsCodeId,strWhsProdCode,strDesc)
values(26,69,3456,'item 1 sma 1')
insert into tblProducts(sinPeriodId,sinWhsCodeId,strWhsProdCode,strDesc)
values(26,69,3456,'item 1 sma 100 g')
insert into tblProducts(sinPeriodId,sinWhsCodeId,strWhsProdCode,strDesc)
values(26,69,3456,'item 1 sma 100 g prod')
insert into tblProducts(sinPeriodId,sinWhsCodeId,strWhsProdCode,strDesc)
values(26,69,3456,'item 1')
Thanks for that,
[quoted text, click to view] "Roji. P. Thomas" wrote:
> Who designed this table?
> Is he available for consulting?
>
>
> --
> Roji. P. Thomas
> Net Asset Management
>
https://www.netassetmanagement.com >
>
> "Enric" <Enric@discussions.microsoft.com> wrote in message
> news:90B3D648-C912-4CCF-A88C-843FC547CDC4@microsoft.com...
> > Dear all,
> >
> > I need to delete duplicates in one table:
> >
> > Desc Product
> >
> > item 1 200 mg 33456
> > item 1 2 33456
> > item 1 200 mg box 2 33456
> > item 1 200 mg box 2 ind 1 33456
> >
> > The way for to do that is the following: When Desc field owns more
> positions (I suppose through Len() function) that one must be remains in the
> aforementioned table.
> > This is: "item 1 200 mg box 2 ind 1" is fine but the another ones erase
> them.
> >
> > Thanks in advance for your support and best regards,
> >
> > Enric
>
>