You are here: splitting a comma seperated column into multiple rows « MsSQL Server « IT news, forums, messages
splitting a comma seperated column into multiple rows

Posted by Hennie7863 on 12/05/68 11:37

Hi i want to create a table as follows :

if exists (select * from dbo.sysobjects where id =
object_id(N'[Indexes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Indexes]
GO

Create table Indexes(indexname Varchar(100), index_Description
Varchar(100), index_keys Varchar(100))
GO

INSERT INTO Indexes EXEC sp_helpindex 'SDM_Fact_Order_Detail'
GO

This will give me a table (northwind)

IX_Auto_SDM_Fact_FK_Shipped_Date nonclustered located on
SAMIS_SDM_Index FK_Shipped_Date

IX_Auto_SDM_Fact_Order_Detail_FK_Insert_Date clustered located on
SAMIS_SDM_Data1 FK_Insert_Date, FK_Insert_Time

As you see sp_helpindex will give me a comma seperated field. I want
to split the third column FK_Insert_Date, FK_Insert_Time into a extra
row
Like this :

IX_Auto_SDM_Fact_FK_Shipped_Date FK_Shipped_Date
IX_Auto_SDM_Fact_Order_Detail_FK_Insert_Date FK_Insert_Date
IX_Auto_SDM_Fact_Order_Detail_FK_Insert_Date FK_Insert_Time

Can anyone help me with this?

Thanx

Hennie

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация