If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > SQL update double datatype

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-09, 23:02
daniel50096230 daniel50096230 is offline
Registered User
 
Join Date: Apr 2009
Posts: 9
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?
Reply With Quote
  #2 (permalink)  
Old 10-19-09, 05:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
your error is here --

UPDATE Trn_BranchReportTop SET Total += ...

SQL does not have this strange operator

try this --

UPDATE Trn_BranchReportTop SET Total = Total + ...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-19-09, 22:16
mirpinbib mirpinbib is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 10-20-09, 14:44
rdjabarov rdjabarov is offline
Registered User
 
Join Date: Jul 2003
Location: San Antonio, TX
Posts: 3,611
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."
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On