Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    9

    Unanswered: SQL update double datatype

    i had the following sql:

    Code:
     Cost = Cost + Convert.ToDouble(dsPODetails.Tables(0).Rows(0).Item("Cost").ToString())
                        Qty1 = Qty1 + Convert.ToDouble(dsPODetails.Tables(0).Rows(0).Item("Qty").ToString())
                        sql = "UPDATE Trn_BranchReportTop SET Total += " + Cost + ",Qty = Qty + Qty1  WHERE SellerID='" + Session.Item("UserCompanyID") + "' AND BranchGLN='" + BranchGLN + "'"
                        objDB.ExecuteNonQuery(sql)
    I would like to update the Total = Total + Cost,how can I modify my sql in order to perform the addition?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    your error is here --

    UPDATE Trn_BranchReportTop SET Total += ...

    SQL does not have this strange operator

    try this --

    UPDATE Trn_BranchReportTop SET Total = Total + ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2009
    Posts
    1
    Hi,

    I will begin a new project soon using SQL Server 2005. I have limited experience w/ 2005 compared to 2000 but I am comfortable with SQL. My challenge here is the client has about 50 million customer records. I have not seen the data yet. It is on an Oracle server with only query rights. I believe I will have to migrate this data into a SQL Server 2005 environment which I have confirmed they have ownership of. I plan to do so in order to have full admin rights, ie to be a real programmer, being able to build objects and massage the data as needed to report upon. I have never worked with this large of a dataset and my questions revolve around optimization. I have been reading up and I understand that I will index everything that is a foreign key, that is straightforward enough but what are the other major and obvious steps that are most effective to make querying this data more efficient? I am considering using indexed views as well. This data will be a lead list for multiple sales people. Any thoughts/questions would be greatly appreciated. Thanks.

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Wow, sounds like you need a real backend developer for this. Considering using indexed views is good, but only if you really understand what they are for and how they apply to the nature of your app. And remember, - skills like this don't come cheap
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •