I have the following LINQPad select statement:
from p in be_Posts
where p.PostID == new Guid( "fb68266f-3ed6-4572-956b-8c2c54a30928" )
select p;
When I run an update batch statement (don't worry I plan on blogging about this whole thing once I've ironed out everything), essentially the SQL command text to run will be:
SET [Author] = @Author0
FROM [be_Posts] AS j0 INNER JOIN (
SELECT [t0].[PostID]
FROM [be_Posts] AS [t0]
WHERE [t0].[PostID] = @p0
) AS j1 ON (j0.[PostID] = j1.[PostID])
-- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [fb68266f-3ed6-4572-956b-8c2c54a30928]
-- @Author0: Input NVarChar (Size = 8; Prec = 0; Scale = 0) [Ann Aney]
-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8
Now, if I take that *exact* SQL to QueryEx or SQL Management Studio, it runs fine, but LINQPad returns an error of:
SqlException: Must declare the scalar variable "@Author0". Incorrect syntax near the keyword 'AS'.
LINQPad obviously display more information I can append if needed, but that is a start. Any ideas to why it wouldn't work only in LINQPad (admittedly I've yet to write a little test app to test it in stand alone C# application).














