declare @d table (a varchar(10), b varchar(20))
insert into @d
values(11111,'1,23,4')
insert into @d
values(11112,'11,231,41')
select a, c.val
from @d cross Apply
fnStringtoTable( b ) c
will throw an error:
"b" is not a recognized table hints option. If it is intended as a parameter to a table-valued function, ensure that your database compatibility mode is set to 90.
If above error comes then do as follows:
EXEC sp_dbcmptlevel 'EZTEST' , 90
GO
declare @d table (a varchar(10), b varchar(20))
insert into @d
values(11111,'1,23,4')
insert into @d
values(11112,'11,231,41')
select a, c.val
from @d cross Apply
fnStringtoTable( b ) c
For More details visit here http://blogs.msdn.com/psssql/archive/2007/10/16/database-compatibility-and-new-features.aspx
Output:
a | b |
11111 | 1 |
11111 | 23 |
11111 | 4 |
11112 | 11 |
11112 | 231 |
11112 | 41 |
No comments:
Post a Comment