先建立一個 db_executor 並給予 EXECUTE 權限,再將需要添加的成員加入角色即可。
CREATE ROLE [db_executor]
GO
GRANT EXECUTE TO [db_executor]
| 本區已經依照台灣網站內容分級規定加入分級標籤, 不歡迎也禁止未滿 18 歲的人員進入本區。 對多元文化的尊重, 也是對您自己, 以及您工作, 或許也包括對您親人的尊重。 如果您了解, 並可以尊重且遵守以上注意事項, 否則請您關閉並離開此板。 內容可能含有與男性間性行為有關的文字, 如果您無法接受男性間性行為, 或對男性間性行為沒有興趣, 請您選擇「離開」 |
先建立一個 db_executor 並給予 EXECUTE 權限,再將需要添加的成員加入角色即可。
CREATE ROLE [db_executor]
GO
GRANT EXECUTE TO [db_executor]

MSDTC
啟用 MSDTC 服務
開始 → 控制台 → 系統管理工具 → 伺服器管理員
設定 → 服務 → Distributed Transaction Coordinator(分散式交易協調器) →
服務啟動類型為自動,服務狀態為已啟動

列印範圍
Separate Print Areas
/*取得日期區間內預設工作日*/
CREATE FUNCTION dbo.PL_getDefaultWorkingDays
(
@StartDate DATE,
@EndDate DATE
EOMONTH (Transact-SQL)
以選擇性位移,傳回包含指定日期的當月最後一天。
SQL Server 2012 版本新增加。
-------------------------------------------------------------------------------------------------------------------------------
使用方式
-------------------------------------------------------------------------------------------------------------------------------
/*
PL_setTempTable 'XX'
.* = application/octet-stream
.001 = application/x-001
.301 = application/x-301
.323 = text/h323
.906 = application/x-906
| 特殊符号 | 命名实体 | 十进制编码 | 特殊符号 | 命名实体 |
子查詢
子查詢意指巢狀結構存在於SELECT、INSERT、UPDATE、DELETE敘述中的SELECT查詢。子查詢可在巢狀子查詢 ,子查詢為join關聯資料子查詢與無關聯資料使用in(某段SELECT資料來源),在效能表現上關連子查詢會較無 關聯子查詢表現較優。
If the results table of your stored proc is too complicated to type out the "create table" statement by hand, and you can't use OPENQUERY OR OPENROWSET, you can use sp_help to generate the list of columns and data types for you. Once you have the list of columns, it's just a matter of formatting it to suit your needs.
Step 1: Add "into #temp" to the output query (e.g. "select [...] into #temp from [...]").
The easiest way is to edit the output query in the proc directly. if you can't change the stored proc, you can copy the contents into a new query window and modify the query there.
Step 2: Run sp_help on the temp table. (e.g. "exec tempdb..sp_help #temp")
After creating the temp table, run sp_help on the temp table to get a list of the columns and data types including the size of varchar fields.