declare @sparsedtable table
(
c1 int primary key,
c2 int null,
c3 int default 0,
c4 int sparse,
c5 int sparse,
c6 int sparse,
cs xml column_set for all_sparse_columns)
insert into @sparsedtable(c1,c2,c3,c4,c5,c6)values(1,2,3,4,5,6)
declare @sparsedtable1 table
(
c1 int primary key,
c2 int null,
c3 int default 0,
c4 int sparse,
c5 int sparse,
c6 int sparse,
c7 varchar(100) sparse,
cs varchar(max) sparse)
insert into @sparsedtable1(c1,c2,c3,c4,c5,c6,c7)values(1,2,3,4,5,6,'fds')
select * from @sparsedtable1
go
declare @DocumentStore TABLE
(DocID int PRIMARY KEY,
Title varchar(200) NOT NULL,
ProductionSpecification varchar(20) SPARSE NULL,
ProductionLocation smallint SPARSE NULL,
MarketingSurveyGroup varchar(20) SPARSE NULL,
Mdate datetime SPARSE NULL,
SpecialPurposeColumns XML COLUMN_SET FOR ALL_SPARSE_COLUMNS )
INSERT @DocumentStore(DocID, Title, ProductionSpecification, ProductionLocation,Mdate)
VALUES (1, 'Tire Spec 1', 'AXZZ217', 27,null)
INSERT @DocumentStore(DocID, Title, MarketingSurveyGroup,Mdate)
VALUES (2, 'Survey 2142', 'Men 25 - 35',null)
INSERT @DocumentStore(DocID, Title, MarketingSurveyGroup,Mdate)
VALUES (3, 'Survey 2142', getdate(), getdate())
INSERT @DocumentStore(DocID, Title, MarketingSurveyGroup,Mdate)
VALUES (4, getdate(), getdate(),null)
select * from @DocumentStore
Ref:http://msdn.microsoft.com/en-us/library/cc280604.aspx
No comments:
Post a Comment