Skip to main content

Questions tagged [linq]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
1 answer
2k views

SQL Server table query with pagination performance tuning, understand the current solution

as stated in the title i start a performance tuning of a table query with pagination generated by a legacy program that use Linq To SQL as ORM. I have found this resource in which is highly ...
Skary's user avatar
  • 368
1 vote
1 answer
671 views

Linq compiled query uses clusted index instead of filtered index

Given the following table CREATE TABLE Test( Id INT PRIMARY KEY IDENTITY(1, 1), Val INT ) CREATE UNIQUE INDEX UX_Test_Val ON Test(Val) WHERE Val IS NOT NULL DECLARE @i INT = 0 WHILE (@i <...
Steve's user avatar
  • 169
-2 votes
1 answer
736 views

How to group by linq based on input parameter? [closed]

I want to use group by in C#, and my result must be like this code in SQL: SELECT MAX(EffectiveDate) AS EffectiveDate,details.PersonnelBaseID FROM dbo.tkp_PersonnelDetails AS details where details....
mhd.cs's user avatar
  • 99
0 votes
1 answer
672 views

Can't get data from stored procedure [closed]

After working on my database a bit, I am working on a VB.Net app that accesses it using LINQ. I have the following stored procedure in the database: CREATE PROCEDURE dbo.GetTableColumn( @ColName ...
Skitzafreak's user avatar
0 votes
2 answers
854 views

Advice needed regarding design of database schema keeping record of current stock

Disclaimer: I am a beginner in the field of database. I am trying to design a database in PostgreSQL which will record the sales and purchases of items. I intend to use this database as the model ...
Sabyasachi Mukherjee's user avatar
3 votes
1 answer
96 views

Is there a need to index the short string code for a faster query?

We have a large number of tables for setup forms. In each form, there is a need to fill in the Code and the Description. The Code consists of a varchar(10) datatype. Now, the thing is, every time a ...
zeroflaw's user avatar
  • 315
-1 votes
1 answer
1k views

Splitting rows into columns with group by clause

I have three tables Lab, Payments and Transaction I want to spilt transType into two columns, sum TransType Group By BillId and compare it with Lab.TotalBill to get Refundable Payments/Due payments I ...
Qasim 's user avatar
0 votes
1 answer
127 views

Check for existing matches to find the field their grouped-by

So I have a table of values associated with different sessions using a field called sessionid, lets say the table has 3 other fields: itemcode, itemcost, & itemeffect. What I end up doing, is ...
Tyeth's user avatar
  • 101
1 vote
1 answer
3k views

Deleting duplicate rows with condition [duplicate]

I have posted a similar question before, but this one is a little modified. I have a table with 4 columns as shown below. ITEMCHARGE CPT4 EFF_DATE CPT4MOD 326.8 29075 ...
Rajesh's user avatar
  • 99
1 vote
2 answers
2k views

Deleting duplicate rows with condition(Using SQL and LINQ)

I have a table with 5 columnsID,CPT4,CPT4Mod,ItemCharge,Eff_Date. Deletion Condition: When rows exists with duplicate CPT4and CPT4Mod field values but different ItemCharge and Eff_Date values, ...
Rajesh's user avatar
  • 99
5 votes
2 answers
9k views

Should I refresh query plan cache

Please let me explain my problem and situation: I have a web application - MVC3, MSSQL Server 2005, LinqToSQL. It has been running great until one fine morning I pushed a lot of rows to a table that ...
bobek's user avatar
  • 161
11 votes
2 answers
197 views

A question on SARGability

I just need to confirm that I understand something correctly: I recently viewed an SO question in which a user posted an answer in Linq like: from p in db.table where p.column.AddMinutes(1) > ...
Stuart Blackler's user avatar
4 votes
1 answer
1k views

Why does DataContext.SubmitChanges() Exist?

I'm not sure if this goes here or on Stack Overflow, but I figure someone here might know it. Why did the developers of LINQ decide that not only do you need ctx.InsertOnSubmit(item); but you also ...
Brian Green's user avatar