Posted on: 6/20/2014 2:58:34 PM | Views : 403

Greetings community,
I’m making the app in .NET, and I don’t really have the problem to get the result, but through watching videos I’ve realized that using LINQ isn’t always the best way of doing things, because it requires pulling too much data through the network to do some LINQ over it. There’s also the issue of security, so I was advised to use stored procedures and functions on SQL server to accomplish what I need without disturbing client machines too much.
I’m absolute beginner in TSQL, so I need your help. I need to extract last order of particular customer and I wonder if that could be accomplished. To make things simple, let’s imagine that my orders table has only these three columns: OrderID (int, primary key, identity incremented), CustomerID (int), and DateOfOrder(datetime). I need a procedure that would take CustomerID as parameter, and return one single row which represent the ...

Go to the complete details ...