This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is any other way to call a table-valued function in SQL Server 2005 except Prepare command ? IDataReader r = UnitOfWork.PrepareCommand(new SqlCommand { CommandText = "SELECT * FROM FuncGetCustomers()" }).ExecuteReader(); ? Thanks. |
|
|
Hello Cezar, This depends on your scenario -- see http://www.mindscape.co.nz/forums/Thread.aspx?PostID=6906 for info about different use cases. |
|
|
Using the ProcedureQuery() method I have next error : ' The request for procedure 'FuncGetCustomers' failed because 'FuncGetCustomers' is a table valued function object.'
Any other suggestion to call table-valued function and the result as entity ? |
|
|
Hmm, strange. I will correct that post -- thanks for letting us know about this. Instead you will need to either wrap the TVF in a stored procedure: CREATE PROCEDURE ProcGetCustomers and call the sproc using a ProcedureQuery, or use the FindBySql method from the latest nightly builds: using (IDbCommand cmd = _unitOfWork.Context.DataProviderObjectFactory.CreateCommand()) |
|
|
Table-valued functions are very usefull. You have to take in consideration upgrading Lightspeed to suport table-valued functions. For now we will change the table-valued functions to stored procedure to avoid SQL code but in the future will be a good point for Lightspeed to suport this kind of functions. Thanks. |
|
|
I have a lot of Table-valued function in my application and I resolve the problem with function that return IQueryable. What is a Table-Valued function? For me, this is like a View but with the ability to add parameters. If you create the same query but in linq in a function that return a IQueryable result instead of IList for example, then you can create another query that use the resultset in the IQueryable function same like it is a Table-Valued function. Ok, you have not the cache capability of SQL Server with Views and Table-Valued functions but it work. |
|