Questions tagged [linq]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
57 views

Alternative to OPTION in views? [closed]

We have this dilemma -- below query runs against one of our VIEWs (which is made up of VIEWs and other TABLES) and takes forever to run (10+ minutes!): SELECT STORE_CD, ITEM_CD, DATE FROM [dbo].[...
user avatar
  • 1
6 votes
1 answer
709 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 ...
user avatar
  • 287
1 vote
1 answer
298 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 <...
user avatar
  • 169
-2 votes
1 answer
474 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....
user avatar
  • 99
0 votes
1 answer
256 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 ...
user avatar
0 votes
2 answers
594 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 ...
user avatar
3 votes
1 answer
89 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 ...
user avatar
  • 315
-1 votes
1 answer
890 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 ...
user avatar
0 votes
1 answer
67 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 ...
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 ...
user avatar
  • 99
1 vote
2 answers
1k 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, ...
user avatar
  • 99
5 votes
2 answers
8k 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 ...
user avatar
  • 161
11 votes
2 answers
195 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) > ...
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 ...
user avatar