SQL Server 2008中,通过XML类型字段查询数据
1 ALTER PROCEDURE p_resource_info_select_by_classification_id_and_keyword 2 @classification_id INT, 3 @keyword NVARCHAR(20) 4 AS 5 BEGIN 6 SELECT * FROM t_resource_info WHERE 7 (‘,‘ + ri_classifications + ‘,‘) LIKE ‘%,‘ + LTRIM(RTRIM(STR(@classification_id))) + ‘,%‘ 8 AND (CONVERT(VARCHAR(MAX), ri_author) LIKE ‘%<Realname>%‘ + @keyword + ‘%</Realname>%‘ OR ri_title_cn LIKE ‘%‘ + @keyword + ‘%‘) 9 END 10 GO 11 12 EXEC p_resource_info_select_by_classification_id_and_keyword 110, ‘a‘
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。