摘要:
启用Ad Hoc Distributed Queries在使用openrowset/opendatasource前搜先要启用Ad Hoc Distributed Queries服务,因为这个服务不安全所以SqlServer默认是关闭的启用Ad Hoc Distributed Queries的方法SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource'的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用sp_configur 阅读全文
摘要:
1.标量值函数 fn_GetMoreKeyWordsSelectExpressionCREATE FUNCTION [dbo].[fn_GetMoreKeyWordsSelectExpression] ( -- Add the parameters for the function here @KeyWords nvarchar(500), --@KeyWords 指:关键字字符串,如 'voa,vs,kk,shouji' @Operation nvarchar(50), --@Operation 指:AND 或 OR 关键字 @ColumName nvarcha... 阅读全文
摘要:
1.按姓氏笔画排序: Select*From TableName OrderBy CustomerName Collate Chinese_PRC_Stroke_ci_as 2.分页SQL语句 select*from(select (row_number() OVER (ORDERBY tab.ID Desc)) as rownum,tab.*from 表名 As tab) As t where rownum between 起始位置 And 结束位置 3.获取当前数据库中的所有用户表 select*from sysobjects where xtype='U'and cate 阅读全文