CREATE TABLE [dbo].[sku_info](
[idsku] [int] IDENTITY(1,1) NOT NULL,
[model_full] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[model_short] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[part_desc] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[sku] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_sku_info] PRIMARY KEY CLUSTERED
(
[idsku] ASC
) ON [PRIMARY]
) ON [PRIMARY]
and some values :
INSERT INTO [reclaim_new].[dbo].[sku_info]
([model_full]
,[model_short]
,[part_desc]
,[sku])
VALUES
('Sanyo 2300 Silver'
,'2300'
,'Test'
,'123')
VALUES
('Sanyo 2300 Black/Silver'
,'2300'
,'Test1'
,'1234')
VALUES
('Sanyo 2300 Pink'
,'2300'
,'Test3'
,'12345')
I need to run a query that will pull all the SKU's that match for
example : Sanyo 2300 Silver
in the above case the results will show me : 123 , 1234 because the
model_full has Sanyo 2300 silver in it..... is this possible to do?
That model is just a variable so the next query could pull all the
SKU's where the model_full is like LG 225 Red...
Although it is not unlikely that you will come to the point where
you will need to use full-text indexing.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Thank you sir! That did the trick.