Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:56:11+00:00 2026-06-06T20:56:11+00:00

I have SQL statements generated like the following. Note that the parameters @p1 and

  • 0

I have SQL statements generated like the following. Note that the parameters @p1 and @p2 are not at all used and no way needed. Why is it coming? How can we remove them?

Note: UpdateCheck is Never for all columns.

Note: The database is updated correctly.

ISSUE

UPDATE [dbo].[BankAccount]
SET [Status] = @p3
WHERE [BankAccountID] = @p0
-- @p0: Input Int (Size = -1; Prec = 0; Scale = 0) [10000]
-- @p1: Input NChar (Size = 10; Prec = 0; Scale = 0) [Fixed     ]
-- @p2: Input NChar (Size = 10; Prec = 0; Scale = 0) [Savings   ]
-- @p3: Input NChar (Size = 10; Prec = 0; Scale = 0) [FrozenFA]

Auto generated class

[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.BankAccount")]
[InheritanceMapping(Code = "Fixed", Type = typeof(FixedBankAccount), IsDefault = true)]
[InheritanceMapping(Code = "Savings", Type = typeof(SavingsBankAccount))]
public partial class BankAccount : INotifyPropertyChanging, INotifyPropertyChanged

TABLE

CREATE TABLE [dbo].[BankAccount](
[BankAccountID] [int] NOT NULL,
[AccountType] [nchar](10) NOT NULL,
[OpenedDate] [datetime] NULL,
[Status] [nchar](10) NULL,
[AccountOwnerID] [int] NULL,
CONSTRAINT [PK_BankAccount] PRIMARY KEY CLUSTERED 
(
[BankAccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

CODE

public class LijosSimpleBankRepository : ILijosBankRepository
{
    public System.Data.Linq.DataContext Context
    {
        get;
        set;
    }


    public List<DBML_Project.BankAccount> GetAllAccountsForUser(int userID)
    {
        IQueryable<DBML_Project.BankAccount> queryResultEntities = Context.GetTable<DBML_Project.BankAccount>().Where(p => p.AccountOwnerID == userID);
        return queryResultEntities.ToList();
    }

    public List<T> GetAllAccountsofType<T>() where T : DBML_Project.BankAccount
    {
        var query = from p in Context.GetTable<DBML_Project.BankAccount>().OfType<T>()
                    select p;

        List<T> typeList = query.ToList();
        return typeList;

    }

    public virtual void UpdateAccount(DBML_Project.BankAccount bankAcc)
    {
        //UPDATE statement will be called only if there has happened a change
        Context.SubmitChanges();
    }

}



namespace ApplicationService_Bank
{
public class BankAccountAppService
{
    public RepositoryLayer.ILijosBankRepository AccountRepository { get; set; }

    public void FreezeAllAccountsForUser(int userId)
    {
        IEnumerable<DBML_Project.BankAccount> accounts = AccountRepository.GetAllAccountsForUser(userId);
        foreach (DBML_Project.BankAccount acc in accounts)
        {

            string getTypeResult = Convert.ToString(acc.GetType());



            acc.Freeze();
            AccountRepository.UpdateAccount(acc);
        }

    }

}


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:56:13+00:00Added an answer on June 6, 2026 at 8:56 pm

    So it is including the discriminator values as parameters? Presumably there are some cases where it uses those in an inheritance-related update (perhaps as part of concurrency checking, although it looks like you’ve disabled that), and it was simply really hard and not worth it to ignore them in the cases where it wasn’t needed, or simply: a bug crept in. Either way, it doesn’t do any harm, other than making the query a tiny tiny bit larger. Not enough to notice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Framework: Rails 2.3.8 Database; PostgreSQL I currently have the following SQL statements (generated by
I have been researching a way to get the SQL statements that are built
I have some sql statements that calculates some numbers. It's possible (with bonus points/penalty
I have two SQL statements: CREATE TABLE legs(legid INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
I have a set of SQL statements formatted like so: INSERT INTO reports.workload (workload_id,event_time,event_type_id,agent_id)
I'm tracking Hibernate's generated SQL statements and their bound parameters using log4j on a
Anyone have a PL-SQL statement that i can use to generate database & tables
I have a sql statement that uses Difference => http://msdn.microsoft.com/en-us/library/ms188753.aspx I do this in
I have this sql statement: CREATE TABLE [dbo].[User]( [UserId] [int] IDENTITY(1,1) NOT NULL, [FirstName]
I have a SQL-statement like this: SELECT name FROM users WHERE deleted = 0;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.