Prev: Sql Server on VMWare
Next: AdventureWorks database
From: Michael Coles on 3 Dec 2009 19:48 Michael, neither LINQ to SQL nor EF 1 currently supports table-valued parameters. -- Thanks Michael Coles SQL Server MVP Author, "Expert SQL Server 2008 Encryption" (http://www.apress.com/book/view/1430224649) ---------------- "Michael C" <mike(a)nospam.com> wrote in message news:%236i4vtGdKHA.2184(a)TK2MSFTNGP04.phx.gbl... > "Erland Sommarskog" <esquel(a)sommarskog.se> wrote in message > news:Xns9CD65EAB57AAEYazorman(a)127.0.0.1... >> I got a straight answer: no, it is not possible. > > You didn't get a straight answer because you have not been able to answer > my question as to whether it is straight linq or linq to sql. Basically > you don't know the most basic detail of this. Are you not in contact with > this person to ask them again? > >> All you have been able to produce is that it works, but you have >> completely >> refused to make any effort to prove it. > > No, I have provided sample code. Did you try my sample code and prove it > does not work? > >> And furthermore, while I do not know LINQ, I know how to pass a TVP >> through >> ADO .Net, and I know that there is no way that LINQ is able to do that >> without someone coding for it. > > So you're saying that it is possible? Of course you need to do some coding > for it. > >> As for it being a minor point, you complained that SQL Server had so >> many limitations that would not happen i C#. I pointed out this >> limitation >> in LINQ, which in my opinion is a considerable limitation. If now LINQ is >> so fantastic, why does it not permit users to utilise the full power of >> SQL Server? > > Even though linq does do this, *if* the limitation did exist it is not > silly like many of the limitations in sqlserver. C# does have limitations > but they are not as silly as those in sqlserver. Don't you think an 8k > limit is the most rediculous thing you've every heard of in 2005? C# just > doesn't have limitations that silly. My point was never that C# didn't > have limitations, just that they weren't as silly as those in sqlserver. > >> Since you have not worked with TVPs and SQL 2008, you could have accepted >> my word for it. Instead you insist on maintaining a position despite you >> don't have the knowledge. > > Because it's fairly clear you don't really know the full details of this > and you've basically admitted it does work with your "without coding for > it" statement. Of course you have to write code for it and of course I'm > going to question you on it. > > Michael >
From: Michael C on 3 Dec 2009 22:40 "Michael Coles" <admin(a)geocodenet.com> wrote in message news:BB74D18C-41C9-4C13-868C-9480479AF2A0(a)microsoft.com... > Michael, neither LINQ to SQL nor EF 1 currently supports table-valued > parameters. Thanks Michael, that is exactly what i have been saying all along. I presume the fact you left out plain linq that means it is possible. And presumably for LINQ to SQL and EF it would just be a limitation of the code generator which could be corrected with some very simple code changes. Michael
From: Michael Coles on 3 Dec 2009 23:07 "Michael C" <mike(a)nospam.com> wrote in message news:uu$IZOJdKHA.4780(a)TK2MSFTNGP04.phx.gbl... > "Michael Coles" <admin(a)geocodenet.com> wrote in message > news:BB74D18C-41C9-4C13-868C-9480479AF2A0(a)microsoft.com... >> Michael, neither LINQ to SQL nor EF 1 currently supports table-valued >> parameters. > > Thanks Michael, that is exactly what i have been saying all along. I > presume the fact you left out plain linq that means it is possible. And > presumably for LINQ to SQL and EF it would just be a limitation of the > code generator which could be corrected with some very simple code > changes. Sorry, you'll have to explain to me what "plain LINQ" is exactly? Is that the LINQ standard query (sequencing) operators as expressed by the standard? If so, SQL Server table-valued parameters don't apply to that level of detail, which is why they're not part of the .NET Standard Query Operators (http://download.microsoft.com/download/5/8/6/5868081c-68aa-40de-9a45-a3803d8134b8/standard_query_operators.doc) or the C# 3.0 specification (http://msdn.microsoft.com/en-us/library/ms364047(VS.80).aspx). Of course I could be wrong. If we're talking about another LINQ provider that currently implements SQL Server TVPs, perhaps you can point us in the direction of that LINQ provider? The only application I'm currently aware of that uses SQL Server TVPs is SQL Server 2008, but I gave up on trying to keep track of LINQ providers after LINQ to Twitter. -- Thanks Michael Coles SQL Server MVP Author, "Expert SQL Server 2008 Encryption" (http://www.apress.com/book/view/1430224649) ----------------
From: Michael C on 3 Dec 2009 23:36 "Michael Coles" <admin(a)geocodenet.com> wrote in message news:eehSfeJdKHA.744(a)TK2MSFTNGP05.phx.gbl... > Sorry, you'll have to explain to me what "plain LINQ" is exactly? Is that > the LINQ standard query (sequencing) operators as expressed by the > standard? If so, SQL Server table-valued parameters don't apply to that > level of detail, which is why they're not part of the .NET Standard Query > Operators > (http://download.microsoft.com/download/5/8/6/5868081c-68aa-40de-9a45-a3803d8134b8/standard_query_operators.doc) > or the C# 3.0 specification > (http://msdn.microsoft.com/en-us/library/ms364047(VS.80).aspx). > > Of course I could be wrong. If we're talking about another LINQ provider > that currently implements SQL Server TVPs, perhaps you can point us in the > direction of that LINQ provider? The only application I'm currently aware > of that uses SQL Server TVPs is SQL Server 2008, but I gave up on trying > to keep track of LINQ providers after LINQ to Twitter. I'm just talking about linq to objects. If we're using linq to objects to format data for a parameter object to call an ADO command object. eg SqlCommand command = CodeToCreateMyCommand(); command.parameters["MyTableVariable"].Value = ResultsFromMyLinqQuery(); command.Execute(); Basically what I am saying is that linq to objects can be used to work with table variables. Michael
From: Michael Coles on 3 Dec 2009 23:59
I see you're using an ADO.NET SqlCommand and .Executing it your example below, but I'm at a loss as to what this has to do with using Table-Valued *Parameters* with LINQ? You're assigning the results of some function that appears to return the results of a LINQ query as a parameter to an ADO.NET SqlCommand. As Erland pointed out, TVPs work with ADO.NET. -- Thanks Michael Coles SQL Server MVP Author, "Expert SQL Server 2008 Encryption" (http://www.apress.com/book/view/1430224649) ---------------- "Michael C" <mike(a)nospam.com> wrote in message news:O73sotJdKHA.4112(a)TK2MSFTNGP06.phx.gbl... > "Michael Coles" <admin(a)geocodenet.com> wrote in message > news:eehSfeJdKHA.744(a)TK2MSFTNGP05.phx.gbl... >> Sorry, you'll have to explain to me what "plain LINQ" is exactly? Is >> that the LINQ standard query (sequencing) operators as expressed by the >> standard? If so, SQL Server table-valued parameters don't apply to that >> level of detail, which is why they're not part of the .NET Standard Query >> Operators >> (http://download.microsoft.com/download/5/8/6/5868081c-68aa-40de-9a45-a3803d8134b8/standard_query_operators.doc) >> or the C# 3.0 specification >> (http://msdn.microsoft.com/en-us/library/ms364047(VS.80).aspx). >> >> Of course I could be wrong. If we're talking about another LINQ provider >> that currently implements SQL Server TVPs, perhaps you can point us in >> the direction of that LINQ provider? The only application I'm currently >> aware of that uses SQL Server TVPs is SQL Server 2008, but I gave up on >> trying to keep track of LINQ providers after LINQ to Twitter. > > I'm just talking about linq to objects. If we're using linq to objects to > format data for a parameter object to call an ADO command object. eg > > SqlCommand command = CodeToCreateMyCommand(); > command.parameters["MyTableVariable"].Value = ResultsFromMyLinqQuery(); > command.Execute(); > > Basically what I am saying is that linq to objects can be used to work > with table variables. > > Michael > |