如何通過EntLib 5.0將表值參數傳遞給SQL Server 2008?如何通過EntLib 5.0將表值參數傳遞給SQL Server 2008?
回答
我還沒有嘗試過這樣做,但已經快速瀏覽了EntLib數據塊,我看不到實現這一點的簡單方法。您可以使用SqlClient對象來完成它,但EntLib不支持您需要將數據作爲TVP傳遞的結構化數據類型。
如果你保證不需要任何東西,除了一個SQL Server後端,那麼我想你可以把你的連接轉換成一個特定於SQLServer的,然後使用SqlParameters,但這會在一定程度上破壞使用EntLib的目的。
感謝您的意見。我也沒有看到明顯的方式,所以我只是使用ADO.NET來完成它。這並不壞。 :) – birdus 2010-12-20 07:40:53
目前尚不支持它,因爲它僅僅是一個Sql 2008功能,並且我們沒有收到很多客戶請求來添加它。 – 2010-12-23 04:48:11
好運... http://msdn.microsoft.com/en-us/library/bb675163.aspx 報價:
表值參數
的侷限性,有若干限制,以表值參數:
You cannot pass table-valued parameters to CLR user-defined functions. Table-valued parameters can only be indexed to support UNIQUE or PRIMARY KEY constraints. SQL Server does not maintain statistics on table-valued parameters. Table-valued parameters are read-only in Transact-SQL code. You cannot update the column values in the rows of a table-valued parameter and you cannot insert or delete rows. To modify the data that is passed to a stored procedure or parameterized statement in table-valued parameter, you must insert the data into a temporary table or into a table variable. You cannot use ALTER TABLE statements to modify the design of table-valued parameters.
- 1. 將參數傳遞給SQL Server 2008
- 2. Delphi - 將表值參數傳遞給SQL Server存儲過程
- 3. C#Winforms - 如何將參數傳遞給SQL Server存儲過程
- 4. sql server:將參數傳遞給視圖
- 5. 表值參數,SQL Server 2008
- 6. 如何通過Webmatrix.Data.Database.Query將表值參數傳遞給存儲過程
- 7. Sql Server - 將數組傳遞給過程
- 8. 如何通過Powershell將參數傳遞給SQL腳本
- 9. 如何通過命令行將參數傳遞給sql腳本
- 10. 如何將表參數傳遞給EF Core中的SQL Server存儲過程?
- 11. 如何將VBA中的值傳遞給SQL Server 2008中的表變量?
- 12. 將參數值傳遞給SSRS 2008中的數據集參數
- 13. 通過url將參數傳遞給bookmarklet
- 14. 通過FormSet將參數傳遞給ModelForm
- 15. 通過在SQL Server 2000中傳遞可變參數來加入表值函數
- 16. 問題將XML參數傳遞給SQL Server存儲過程
- 17. 將xml字符串參數傳遞給SQL Server存儲過程
- 18. 將一個布爾參數傳遞給SQL Server存儲過程
- 19. 使用PHP PDO將參數傳遞給SQL Server存儲過程
- 20. 如何將此信息傳遞給SQL Server 2008?
- 21. 如何在SQL Server 2008中使用動態查詢傳遞表值參數
- 22. 如何將參數傳遞給SQL Server Reporting Services中的Query.CommandText?
- 23. 如何通過鏈接服務器將表或表值參數從SQL2008傳遞給Oracle過程?
- 24. 如何將參數值傳遞給Popen?
- 25. 如何將參數值傳遞給a4j:jsFunction
- 26. 如何將參數值傳遞給XSL?
- 27. 通過URL將CGI參數傳遞給表單
- 28. 如何將可變數量的參數傳遞給SQL Server存儲過程?
- 29. 如何通過POST將參數傳遞給Azure函數?
- 30. 如何將表值參數傳遞給存儲過程從.net代碼
很感興趣聽取如何/如何可能。 – TarasB 2010-12-18 19:23:44