views:

28

answers:

2

hi, i have a lot of methods wrote with.net codes (c#) to using with linq queries. but i have problem to translating methods to t-sql. and i want to convert that to t-sql functions and using that with t-sql queries directly. how?

+2  A: 

Porting data access layers like this is error-prone. I suggest you first create unit tests for all of the methods you want to convert. Then port over to SQL. You don't necessarily want to run the same SQL as is output by LINQ To SQL, as you can likely improve on the performance by hand-coding the queries, but to get an idea of what LINQ to SQL is doing, you can trace the SQL on your SQL Server.

RedFilter
Even though I posted a response... I have to agree...this is probably a bad idea.
Ryan Bennett
+3  A: 

Translating Linq to Sql... I would recommend downloading LinqPad then. Linqpad.net. It should do a reasonable job for you.

Ryan Bennett
+1: Good point, forgot about that handy tool!
RedFilter