Data Not Updating Without Error I Think.

Jun 2, 2006

Sorry if this is a dumb question but I am just learning ASP.NET.  My database is on a server running SQL Server 2000 and I have used Dreamweaver to build sites.  I am trying to convert to ASP.NET. 

The problem I am having is that data is not updating when I change it in a GridView, DataList, etc.  I have tried including the user name an password in the connection string without success.  What did I miss?

connectionString="Data Source=<ServerName>;Initial Catalog=<DatabaseName>;Integrated Security=True;Uid=sa;Pwd=<Password>;"

This is the string I use in Dreamweaver which works;
Driver={SQL Server};Server=<ServerName>;Database=<DatabaseName>;Uid=sa;Pwd=<Password>;

View 2 Replies


ADVERTISEMENT

Integration Services :: Error While Updating Data To Sharepoint?

Jul 1, 2015

There is a requirement to insert if there is a new record/update the existing record to Sharepoint. Am able to do Insert/Update to SharePoint if the data quantity is minimum, i.e, records in hundreds.

link: [URL] ....

if the records/data is more(in thousands), while updating to sharepoint, am getting below error. I tried to keep the minimal batch size, but still getting the same error.Is there any setting on Sharepoint that can be set to increase updation capability?

Error details:

 System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method
is implemented properly. The first 1024 bytes of the response were: '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

[code].....

what is the cause of this error?

View 2 Replies View Related

Updating A Table By Both Inserting And Updating In The Data Flow

Sep 21, 2006

I am very new to SQL Server 2005. I have created a package to load data from a flat delimited file to a database table. The initial load has worked. However, in the future, I will have flat files used to update the table. Some of the records will need to be inserted and some will need to update existing rows. I am trying to do this from SSIS. However, I am very lost as to how to do this.

Any suggestions?

View 7 Replies View Related

SQL Server Admin 2014 :: Error While Updating Data Using Oracle Linked Server

Sep 11, 2015

We have oracle linked server created on one of the sql server 2008 standard , we are fetching data from oracle and updating some records in sql server . Previously its working fine but we are suddenly facing below issue.

Below error occurred during process .

OLE DB provider "OraOLEDB.Oracle" for linked server "<linkedservername>" returned message "".
Msg 7346, Level 16, State 2, Line 1
Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "<linked server name>".

View 7 Replies View Related

Sql Server 2005 Dev Edition Error - Unexpected Error While Updating Installed Files

Feb 14, 2007

I am attempting to install SQL Server 2005 Developer Edition onto a Windows XP Pro SP2 machine, but unfortunately each time that I attempt to install I receive an error message in the summary log as follows:

Product : Microsoft SQL Server 2005
Product Version: 9.00.1399.06
Install : Failed
Log File : C:Program FilesMicrosoft SQL Server90Setup
Last Action : InstallFinalize
Error String : The setup has encountered an unexpected error while Updating Installed Files.
The error is : Fatal error during installation.
Error Number : 29528

There is probably a simple solution for the issue but unfortunately I am unaware of what it is? I can€™t tell if the issue is specific to registry settings, security, file types, etc€¦ The information below surrounds the error w/in the log, any suggestions would be greatly appreciated?

Thanks, Jennifer

MSI (s) (6C:94) [16:02:23:713]: Executing op: SetTargetFolder(Folder=C:WINNTsystem32)
MSI (s) (6C:94) [16:02:23:713]: Executing op: SetSourceFolder(Folder=1System)
MSI (s) (6C:94) [16:02:23:713]: Executing op: FileCopy(SourceName=sqlctr90.dll,SourceCabKey=sqlctr90.dll.7188DA12_A95E_46B7_8623_9D93B5260E2A,DestName=sqlctr90.dll,Attributes=16384,FileSize=66264,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,Version=2005.90.1399.0,Language=1033,InstallMode=58982400,,,,,,,)
MSI (s) (6C:94) [16:02:23:713]: File: C:WINNTsystem32sqlctr90.dll; To be installed; Won't patch; No existing file
MSI (s) (6C:94) [16:02:23:713]: Source for file 'sqlctr90.dll.7188DA12_A95E_46B7_8623_9D93B5260E2A' is compressed
MSI (s) (6C:94) [16:02:23:713]: Note: 1: 2318 2: C:WINNTsystem32sqlctr90.dll
MSI (s) (6C:94) [16:02:23:713]: Note: 1: 2360
MSI (s) (6C:94) [16:02:23:713]: Note: 1: 2360
MSI (s) (6C:94) [16:02:23:723]: Executing op: CacheSizeFlush(,)
MSI (s) (6C:94) [16:02:23:723]: Executing op: InstallProtectedFiles(AllowUI=0)
MSI (s) (6C:94) [16:02:23:723]: Executing op: ActionStart(Name=CAFTEInstallFTERef.68C6D15C_77E0_11D5_8528_00C04F68155C,,)
MSI (s) (6C:94) [16:02:23:733]: Executing op: CustomActionSchedule(Action=CAFTEInstallFTERef.68C6D15C_77E0_11D5_8528_00C04F68155C,ActionType=1025,Source=BinaryData,Target=InstallFTERef,CustomActionData=C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinnFTERef|C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTData)
MSI (s) (6C:2C) [16:02:23:743]: Invoking remote custom action. DLL: C:WINNTInstallerMSI64E.tmp, Entrypoint: InstallFTERef
FTECa.DLL: INFO: FTE: InstallFTERef(), Entering...
FTECa.DLL: INFO: FTE: GetFTERefInstallParams: FTERef : C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTData
FTECa.DLL: INFO: FTE: InstallFTERef: File created: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTDataoiseCHS.txt Size=1000 IDR=1696
.
.
.
.
.
.
FTECa.DLL: INFO: FTE: InstallFTERef: File created: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTData sSVE.xml Size=1035 IDR=1142
FTECa.DLL: INFO: FTE: InstallFTERef: File created: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTDataoiseTHA.txt Size=1036 IDR=697
FTECa.DLL: INFO: FTE: InstallFTERef: File created: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTData sTHA.xml Size=1037 IDR=1142
FTECa.DLL: INFO: FTE: InstallFTERef: File created: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTDataoiseTRK.txt Size=1038 IDR=2224
MSI (s) (6C:94) [16:02:24:454]: Executing op: ActionStart(Name=Rollback_UpdateETWMOFWithGUID.D20239D7_E87C_40C9_9837_E70B8D4882C2,Description=Removing registry updates,)
FTECa.DLL: INFO: FTE: InstallFTERef: File created: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLFTData sTRK.xml Size=1039 IDR=1142
MSI (s) (6C:94) [16:02:24:454]: Executing op: CustomActionSchedule(Action=Rollback_UpdateETWMOFWithGUID.D20239D7_E87C_40C9_9837_E70B8D4882C2,ActionType=1345,Source=BinaryData,Target=Rollback_UpdateETWMOFWithGUID,CustomActionData=100Removing registry updates100000{2373A92B-1C1C-4E71-B494-5CA97F96AA19}MSSQLSERVERC:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinn)
MSI (s) (6C:94) [16:02:24:454]: Executing op: ActionStart(Name=Do_UpdateETWMOFWithGUID.D20239D7_E87C_40C9_9837_E70B8D4882C2,Description=Updating Installed Files,)
MSI (s) (6C:94) [16:02:24:454]: Executing op: CustomActionSchedule(Action=Do_UpdateETWMOFWithGUID.D20239D7_E87C_40C9_9837_E70B8D4882C2,ActionType=1025,Source=BinaryData,Target=Do_UpdateETWMOFWithGUID,CustomActionData=010Updating Installed Files100000{2373A92B-1C1C-4E71-B494-5CA97F96AA19}MSSQLSERVERC:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinn)
MSI (s) (6C:10) [16:02:24:464]: Invoking remote custom action. DLL: C:WINNTInstallerMSI64F.tmp, Entrypoint: Do_UpdateETWMOFWithGUID
<Func Name='LaunchFunction'>
Function=Do_UpdateETWMOFWithGUID
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='T' GetLastError='203'>
Doing Action: Do_UpdateETWMOFWithGUID
PerfTime Start: Do_UpdateETWMOFWithGUID : Tue Feb 13 16:02:24 2007
<Func Name='Do_UpdateETWMOFWithGUID'>
Calling installSqlEvent Trance
The arguments that are passed to InstallSqlEventTrace are InstanceName: MSSQLSERVER , ProductCodeL: {2373A92B-1C1C-4E71-B494-5CA97F96AA19} , BinPath: C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinn
INFO: Checking installed version
INFO: Writing MOF file
ERROR: Unable to open registry key: HRESULT = 0x80070005, Key = SYSTEMCurrentControlSetControlWMISecurity

The value returned is -2147024891
<EndFunc Name='Do_UpdateETWMOFWithGUID' Return='1603' GetLastError='0'>
PerfTime Stop: Do_UpdateETWMOFWithGUID : Tue Feb 13 16:02:24 2007
Gathering darwin properties for failure handling.
Error Code: 1603
MSI (s) (6C!D0) [16:02:37:273]: Product: Microsoft SQL Server 2005 -- Error 29528. The setup has encountered an unexpected error while Updating Installed Files. The error is: Fatal error during installation.

Error 29528. The setup has encountered an unexpected error while Updating Installed Files. The error is: Fatal error during installation.

<EndFunc Name='LaunchFunction' Return='1603' GetLastError='203'>
MSI (s) (6C:94) [16:02:37:283]: User policy value 'DisableRollback' is 0
MSI (s) (6C:94) [16:02:37:283]: Machine policy value 'DisableRollback' is 0
Action ended 16:02:37: InstallFinalize. Return value 3.

View 8 Replies View Related

Trans Replication With Updating Subscriber On Sql2000 (single Quote In The Data As Char Data Type)

Nov 17, 2006

Hi,

I am trying to setup Trans Replication with updating subscriber on sql2000. One column on few tables got data with single quote (').

How do I handle in this case? Did any one come across such case?

Can I Change default QUOTED IDENTIFIER from ' (single quote) to something else (@@@) on SQL2000?

If yes, how to do?

Thanks
mka

View 1 Replies View Related

Error While Updating

Nov 5, 2001

Hi....Whenever I try to update the database and include an apostrophe ....then I get an error that says 'Incorrect Syntax' ....I will be very greatful if u could help me out with this.....

View 3 Replies View Related

Error When Updating Database

Oct 28, 2004

Hi all,
I'm getting an error when updating my database. The connection is fine and the dropdown menu is good also so i think it's the way i've formed my sql string. Here's the line i think i'm having probs with:


SQLString = "UPDATE project_descriptions SET " & _
"lecturer_name = '" & Replace(LecturerName.Text,"'","''") & "'," & _
"project_title = '" & Replace(ProjectTitle.Text,"'","''") & "', " & _
"Project_description = '" & Replace(ProjectDescription.Text,"'","''") & "'," & _
" WHERE project_code = '" & ProjectCode.SelectedItem.Value & "'"


Can anyone rearrange it so i stop getting an error?

Here's my code. if it helps.


<%@ Import Namespace="System.Data.OleDb" %>

<SCRIPT language="VB" runat="server">

Dim DBConnection As OleDbConnection
Dim DBCommand As OleDbCommand
Dim DBReader As OleDbDataReader
Dim SQLString As String

Sub Page_Load

If Not Page.IsPostBack Then

'-- Load drop-down list with item numbers
DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:finalyearproject2projectallocation.mdb")
DBConnection.Open()
SQLString = "SELECT project_code FROM project_descriptions ORDER BY project_code"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBReader = DBCommand.ExecuteReader()
ProjectCode.DataSource = DBReader
ProjectCode.DataTextField = "project_code"
ProjectCode.DataValueField = "project_code"
ProjectCode.DataBind()
DBReader.Close()
DBConnection.Close()


End If

End Sub

Sub SelectRecord (Src As Object, Args As EventArgs)

DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:finalyearproject2projectallocation.mdb")
DBConnection.Open()
SQLString = "SELECT * FROM project_descriptions WHERE " & _
"project_code = '" & ProjectCode.SelectedItem.Value & "'"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBReader = DBCommand.ExecuteReader()
DBReader.Read()
LecturerName.Text = DBReader("lecturer_name")
ProjectTitle.Text = DBReader("project_title")
ProjectDescription.Text = DBReader("project_description")
DBReader.Close()
DBConnection.Close()
UpdateButton.Visible = True

End Sub


Sub UpdateRecord (Src As Object, Args As EventArgs)

'-- CHECK FOR VALID RECORD ---
Dim ValidRecord As Boolean = True

'-- Check for missing Project Title
If ProjectTitle.Text = "" Then
ProjectTitleMessage.Text = "Missing Project Title"
ValidRecord = False
End If

'-- Check for missing Lecturer Name
If LecturerName.Text = "" Then
LecturerNameMessage.Text = "Missing Lecturer Name"
ValidRecord = False
End If

'-- Check for missing Project Description
If ProjectDescription.Text = "" Then
ProjectDescriptionMessage.Text = "Missing Project Description"
ValidRecord = False
End If




If ValidRecord = True Then

'-- UPDATE A RECORD --
Try
DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:finalyearproject2projectallocation.mdb")
DBConnection.Open()


SQLString = "UPDATE project_descriptions SET " "lecturer_name = '" & Replace(LecturerName.Text,"'","''") & "'," "project_title = '" & Replace(ProjectTitle.Text,"'","''") & "', " "Project_description = '" & Replace(ProjectDescription.Text,"'","''") & "'," " WHERE project_code = '" & ProjectCode.SelectedItem.Value & "'"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBCommand.ExecuteNonQuery
DBConnection.Close()
UpdateMessage.Text = "Record updated"
Catch
UpdateMessage.Text = "Update problem. Record not changed. " & SQLString
End Try

End If

End Sub


</SCRIPT>

<html>
<head>


<style>
.head {font-family:arial; font-size:12pt; font-weight:bold; width:560px;
border:outset 1 #F0F0F0; padding:2pt; background-color:#990000;
color:#FFFFFF; text-align:center}
.box {font-family:arial; font-size:8pt; line-height:9pt; width:200px;
height:20px; overflow:auto}
.right {text-align:right}
.center {text-align:center}
table {font-family:arial; font-size:8pt; line-height:9pt; width:560px;
background-color:#F9F9F9; border-collapse:collapse}
th {font-family:arial; font-size:8pt; line-height:14pt;
font-weight:bold; text-align:center; vertical-align:bottom;
background-color:#990000; color:#FFFFFF}
td {font-family:arial; font-size:8pt; line-height:9pt;
vertical-align:top}
</style>
</head>

<body>
<form runat="server">

<div class="head">Project Update</div>

<table id="UpdateTable" border="1" rules="rows">
<tr>
<th> Project Code: </th>
<td><asp:DropDownList id="ProjectCode" runat="server"/>
<asp:Button Text="Select" OnClick="SelectRecord" runat="server"/>
</td>
<td></td>
</tr>
<tr>
<th> Lecturer Name: </th>
<td><asp:TextBox id="LecturerName" runat="server"
Columns="40"
MaxLength="50"/></td>
<td><asp:Label id="LecturerNameMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/></td>
</tr>

<tr>
<th> Project Title: </th>
<td><asp:TextBox id="ProjectTitle" runat="server"
Columns="40"
MaxLength="50"/></td>
<td><asp:Label id="ProjectTitleMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/></td>
</tr>

<tr>
<th> Project Description: </th>
<td><asp:TextBox id="ProjectDescription" runat="server"
TextMode="MultiLine"
Columns="45"
rows="3"/></td>
<td><asp:Label id="ProjectDescriptionMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/></td>
</tr>

</asp:Panel>

</table>
<br>
<asp:Button id="UpdateButton" runat="server"
Text="Update Record"
Visible="False"
OnClick="UpdateRecord"/>
<asp:Label id="UpdateMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/>
</form>
</body>
</html>

View 4 Replies View Related

Error While Updating INDEXES

Oct 19, 2005

I was updating few indexes in one of my database tables when I got this warning message:
"Warning! The maximum key length is 900 bytes. The index 'IX_cc_statusText' has maximum length of 1024 bytes. For some combination of large values, the insert/update operation will fail."

Can anyone help me out as to:
1. Why this warning was thrown?
2. What are the implications of the same?
3. How to rectify this?

Here is the script I was using to update the indexes:


CREATE INDEX [cc_programEnrollment14] ON [dbo].[cc_programEnrollment]([cc_company_uid]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_program_uid] ON [dbo].[cc_programEnrollment]([cc_program_uid]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_status_uid] ON [dbo].[cc_programEnrollment]([cc_status_uid]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_CompanyID] ON [dbo].[cc_programEnrollment]([cc_CompanyID]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_statusText] ON [dbo].[cc_programEnrollment]([cc_statusText]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_initiatedDate] ON [dbo].[cc_programEnrollment]([cc_initiatedDate]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_initiatedBy_uid] ON [dbo].[cc_programEnrollment]([cc_initiatedBy_uid]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_SponsorID] ON [dbo].[cc_programEnrollment]([cc_SponsorID]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_SponsorDistributor_uid] ON [dbo].[cc_programEnrollment]([cc_SponsorDistributor_uid]) ON [PRIMARY]
GO

CREATE INDEX [IX_cc_programEnrollment] ON [dbo].[cc_programEnrollment]([cc_isDealerEligible], [cc_uid]) ON [PRIMARY]
GO


Thanks in advance
Dexter

View 1 Replies View Related

Error Updating A Table

Dec 29, 2005

I am trying to update one of the databases Jobs table Via an asp page because the amount of text in the field is too large to to be added via the DTS import wizard. I keep getting the following error.

Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'Jobs'.


The table Jobs definately exists in the database. I double checked the System DSN to make sure that it was pointing to this database. What do I need to look for to fix this?

oops, Forgot to show the sql statement this is using, I am using ADO to insert the data vs using an Update Query because of the number of apostrophe's etc in the variables.

SELECT description FROM Jobs WHERE JobID = 1

Miranda

View 2 Replies View Related

Updating Data

Apr 18, 2008

building some kind of ecommerce site.
I want to allow the user to modify the image that he has stored for a product.
The image is stored in a directory, in the table GAMME I only have the image name.
When the user selects a new Image, I first delete the old image in the directory, then save the new image, but what I can't do is to update the table with the new image name, when I write sqldatasource1.update() I have an error "the dictionnary passed with old values is empty"(translated from frengh).
the update statement in sqldatasource1 is: " UPDATE Gamme SET imagename = @imagename, imagesize = @imagesize WHERE (product_ID = @original_product_ID)"
 
on events sqldatasource1.updating I have written:
e.Command.Parameters("@imagename").Value = (FileUpload1.FileName).ToString()
e.Command.Parameters("@taillevignette").Value = FileUpload1.PostedFile.ContentLength
e.Command.Parameters("@original_product_ID").Value = Session("Product_ID").ToString         
 this is not written but the session("product_ID") is the good value
the problem must come from the last lign, but I don't Understand the problem and how to solve it.
 
 

View 1 Replies View Related

Updating Data

Oct 2, 2000

Hi,

I would like to update about 4,000 records. I would only be updating one column for 4,000 rows in a table that has 50,000 rows. The update information is not the same for each row. I will be updating this from an excell file. Can somebody please tell me how to do this without messing the rest of the data in the table?

Thank you
JG

View 1 Replies View Related

Updating Data

Apr 23, 1999

I rebuilt my databases using bcp,in order to change sort order and char set. That was OK,the data were re-inserted,but now i can only modify data by SQL Server Enterprise Manager.When a try to chage data by Visual Data Manager or VB application using ODBDC,it's accused that the database is not updatable,it's read only.But in the properties it's updatable.Anybody has a hint of what'sgoing on??

Thanks for yoour attention again,
Luciano

View 1 Replies View Related

Help On Updating Data

May 13, 2008

Hi,

What is the best to update line_no in following code.
As you can see 1 invoice can have multiple lines.
I would like to assign sequential number to all lines in invoice.


CREATE TABLE #xx (invoicenumber INT, line_no int )

INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(2000,0)
INSERT INTO #xx VALUES(2000,0)
INSERT INTO #xx VALUES(2000,0)
INSERT INTO #xx VALUES(2000,0)

SELECT * FROM #xx


result of select * from #xx should be:
10001
10002
10003
10004
20001
20002
20003
20004



Thanks

mk_garg

View 2 Replies View Related

Help Updating Data

May 13, 2008

Hi,

What is the best to update line_no in following code.
As you can see 1 invoice can have multiple lines.


CREATE TABLE #xx (invoicenumber INT, line_no int )

INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(1000,0)
INSERT INTO #xx VALUES(2000,0)
INSERT INTO #xx VALUES(2000,0)
INSERT INTO #xx VALUES(2000,0)
INSERT INTO #xx VALUES(2000,0)

SELECT * FROM #xx



result of select * from #xx should be:
1000 1
1000 1
1000 1
1000 1
2000 2
2000 2
2000 2
2000 2



Thanks

mk_garg

View 3 Replies View Related

Help Updating Data

Jun 24, 2008

I have posted on this problem before, and got some wonderful help, but the problems keep growing!

In my table, I have projects,activities, credit amount, debit amount, starting balance.
Each project can have several activities associated with it. Each project has a starting balance. Each activity posts an expense to the starting balance of the project.
If the project has enough money to handle the charges made by the activities, all the activity expenses can be "posted". Then I want to re-adjust the balance and
check the second activity. If there is still enough money to handle the charge from the second activity, then the expenses can be posted and the balance
adjusted again. In this checking, I am creating a field called status, and flagging if the activity can clear or not, and a new balance field. The data I have can fall into
different examples, listed below.

First example:Only one activity for a project
project: 122400
activity: 0000
Cr_Amt: 2145.00
Dr_Amt: 0
Balance: 1190.00

In the above case, as the balance is less than the Cr_Amt, I want to set the Cr_Amt = Balance, and the new balance = 0 and have done that as follows:

Update r
set r.Post_Cr = r.Bal_2300,
r.new_Status = 'Can Clear',
r.new_Balance = 0
From Rev_Rec_Check r
WHERE r.project IN (Select project
from Rev_Rec_Check d
group by d.Project
having count(d.project) = 1)

That seems to work for me.

Second Example: More than one activity, with credits and debits
project: 145587
activity: 0000
Cr_Amt: 0
Dr_Amt: 2500
Balance: 1452

project: 145587
activity: 0110
Cr_Amt: 3953
Dr_Amt: 0
Balance: 1452

So, in this case, I need to add the Dr_Amt to the Balance and create a new balance (3952), and then check that the Balance can cover the Cr_Amt

UPDATE t
SET t.New_Balance=(t.Bal_2300 + b.postDrSum) - b.PostCRSum,
t.New_Status=(CASE WHEN (t.Bal_2300 -b.PostCRSum) >0 THEN 'Can Clear'
ELSE 'Still Check'
END)
FROM Rev_Rec_Check t CROSS APPLY
(SELECT SUM(post_Cr) as postCrSum, SUM(post_Dr) as postDrSum
FROM Rev_Rec_Check a
WHERE (a.project =t.project)
AND (a.activity<=t.activity)) b

This does seems to work, and gives me the correct status, and adjusts the new balance correctly, but I realize that doing that doesn't achieve what I want.
Ideally, in this example - where there is more than one project/activity, this is what I would like to see:
project: 145587
activity: 0000
Cr_Amt: 0
Dr_Amt: 2500
Balance: 1452
newBalance: 3952

project: 145587
activity: 0110
Cr_Amt: 3952
Dr_Amt: 0
Balance: 1452
newBalance: 0

I want the amount that gets posted (the Cr_Amt) to reflect what is left in the balance.

There could be cases where there are several activities for one project, so I want to be able to scroll through each activity and post what I can from what
they have left in their balance.

I don't know how to approach this. Am I making it more complicated than it actually is? Have I made any sense in trying to explain it?

Thanks in advance for any help!

View 6 Replies View Related

Updating The SQL Data

Sep 12, 2006

skumar writes "Hi guys,

i'm a newbie in database and i need some ideas for the below mentioned
problem.

i'm creating sql table from a txt file using DTS package, now once the table
gets created, i need to multiple some revenue accounts with xyz number and
expense accounts with abc number.

i'm thinking more towards the line of writing a store procedure but don't
have any experience in it.

PLease guide me in the right direction, also if a good book could be refered
for future; which will help me query language and this kind of issues, that
will be GREAT!!

Thanx in advance"

View 2 Replies View Related

Updating Data

Oct 12, 2007

I have the following below. I have a page that has a text box. I want it to look in the database (SQL Server 2005) and display the number (Assessor_Score) in the box if it exist. If it does not exist I want the user to put a number in and have it insert a new record to the database. I also want the user to be able to change the number that does show up. The code below just inserts two identical records into the database. Also, how do I assign Assessor_Score a value from the textbox to use in the insert statement? Thanks

Dim pageTitle, sRedirect, str
pageTitle = "QRS Assessors's Score"
dim iAsmtID, sSubScale_Short, Assessor_Score, sScale, sSubScale
Assessor_Score = request.Form("Assessor_Score")
sRedirect = request.QueryString("sRedirect")
iAsmtID = request.QueryString("iAsmtID")
sScale = request.QueryString("sScale")
sSubScale_Short = request.QueryString("sSubScale_Short")
sSubScale = request.QueryString("sSubScale")
sFormAction = "/Member/FSR/FSR_ScoreSheet.asp?iAsmtID=" & iAsmtID

'Open Connection
set conn = Server.CreateObject("ADODB.Connection")
conn.open NCRLAP_Conn
set rs = Server.CreateObject("ADODB.Recordset")
set rs2 = Server.CreateObject("ADODB.Recordset")

''''''''''''''''''Get QRS Assessor's Score''''''''''''''''''
str = "SELECT AssessorScore.iAsmtID, AssessorScore.sSubScale_Short, AssessorScore.Assessor_Score FROM AssessorScore WHERE (((AssessorScore.sSubScale_Short)='" & sSubScale_Short & "') AND ((AssessorScore.iAsmtID)=" & iAsmtID & "))"
set rs = conn.execute(str)
If rs.EOF = True then
'This score is not currently in Assessor_Score
'Insert now

str = "INSERT INTO AssessorScore (iAsmtID,sSubScale_Short,Assessor_Score) " & _
"VALUES ('" & iAsmtID & "','" & sSubScale_Short & "','" & Assessor_Score & "')"
response.Write(str)
conn.execute(str)
Else
This score is currently in Assessor_Score
Assessor_Score = rs("Assessor_Score")
UPDATE now
str = "Update AssessorScore SET AssessorScore.iAsmtID = " & iAsmtID & ", AssessorScore.sSubScale_Short = " & sSubScale_Short & ", AssessorScore.Assessor_Score = " & Assessor_Score & " WHERE (((AssessorScore.sSubScale_Short)=" & sSubScale_Short & ") AND ((AssessorScore.iAsmtID)=" & iAsmtID & "))"
End If
'response.Write(str)
set rs = nothing
conn.execute(str)
str = ""

View 1 Replies View Related

Updating Data

Feb 20, 2006

Hello.

Is it possible to somehow update data as it is copied from source to destination using SSIS.

Currently I extract data from Database A, load it into database B, then clean/update the data in database B and then load it into database C using DTS on 2000.

What I would like to do is extract data from database A, clean/update it, then load it straight into database C without having to load it into database B first.

I am unable to clean/update the source data in database A, as this would be the obvious thing to do.

Thanks.











View 15 Replies View Related

Out Of Range Error When Updating A Decimal Value

Dec 5, 2006

I am trying to update a database that has decimal(4,1) in a field.  It can hold 100, but when I change a value in a gridview to 100 and update it, I get the error below.  Any reason wny?  Parameter value '100.0' is out of range.



Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.

Exception Details: System.ArgumentException: Parameter value '100.0' is out of range.

Source Error:




Line 1841: int returnValue;Line 1842: try {Line 1843: returnValue = command.ExecuteNonQuery();Line 1844: }Line 1845: finally {







Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesmyprofile45e0ea66e9c9d282App_Code._wfrgryw.27.cs    Line: 1843


Stack Trace:




[ArgumentException: Parameter value '100.0' is out of range.] System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj) +4085 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +413 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +11 5 StatisticsDALTableAdapters.StatisticsTableAdapter.UpdateStatistics(Nullable`1 ID, Nullable`1 PlayerID, Nullable`1 FG, Nullable`1 TTP, Nullable`1 FT, Nullable`1 RPG, Nullable`1 DEFR, Nullable`1 OFFR, Nullable`1 APG, Nullable`1 SPG, Nullable`1 BPG, Nullable`1 Turnovers, Nullable`1 PPG, String SYear, String EYear, String StatisticsType) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesmyprofile45e0ea66e9c9d282App_Code._wfrgryw.27.cs:1843 YourHoopSpace.BLL.StatisticsBLL.UpdateStatistic(Int32 ID, Int32 playerID, Nullable`1 fg, Nullable`1 ttp, Nullable`1 ft, Nullable`1 rpg, Nullable`1 defr, Nullable`1 offr, Nullable`1 apg, Nullable`1 spg, Nullable`1 bpg, Nullable`1 turnovers, Nullable`1 ppg, String sYear, String eYear, String statisticsType) in f:MyProfileApp_CodeBLLStatisticsBLL.cs:128

View 5 Replies View Related

Sytntax Error Updating Column

Jan 30, 2007

Hello
I am trying to update a column within a table.  I need to change all the (null) to yes. But  I keep seeing Error:  0 record(s) affected.  What is wrong with my syntax. 
My table name:  Cat_B
Column: Blog
Current cell data: (null)
Update to: yes
This is the syntax I have tried:
 UPDATE Cat_B
SET  Blog = 'yes'
Where Blog = '(null)'
 
Thanks
Lynn
 
 

View 2 Replies View Related

Error - Updating Tables Row Using SqlDataSource

May 29, 2007

I have such a problem:i try to update a row in my table using:    protected void selectButton_Click(object sender, EventArgs e)    {        String taskID = projectsGridView.SelectedRow.Cells[0].Text;        usersSqlDataSource.UpdateCommand = "update [Users] set [TaskID]=@task where [UserID]=1";        usersSqlDataSource.UpdateParameters.Add("task", taskID);        usersSqlDataSource.Update();    }And i receive error on  usersSqlDataSource.Update():You have specified that your update command compares all values on SqlDataSource 'usersSqlDataSource', but the dictionary passed in for oldValues is emptyWhat have i done wrong? Parameter are not set? 

View 3 Replies View Related

Error Updating A DateTime Field

Oct 11, 2005

Hi, I'm having trouble updating a DateTime field in my SQL database.  Here is what I'm trying to do....I retrieve the existing value in the DateTime field (usually a bum date like 1/1/1900 00:00:00:00), then put it in a variable.  Later, depending on some conditions, I'll either update the DateTime field to today's date (which works great) or set it back equal to the existing value from the variable (this one messes up and says "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. ").  There is a ton more than this but here are the relevant snippets:<code>Dim CompDate As DateTimeDim aComm As SQLCommand Dim aReader As SQLDataReader Dim bSQL,bConn As String bSQL= "SELECT CompleteDate,StatusOfMarkout FROM Tickets WHERE TicketName=" _ & CHR(39) & Trim(Ticket.Text) & CHR(39) bConn = serverStuff aConn = New SQLConnection(bConn) aComm = New SQLCommand(bSQL,aConn) aConn.Open() result = aComm.ExecuteReader() 'fills controls with data While result.Read()    CompDate = result("CompleteDate")    PreviousMarkoutStatus.Text = result("StatusOfMarkout") End While result.Close() aConn.Close()sSqlCmd ="Update OneCallTickets CompleteDate=@CompleteDate, StatusOfMarkout=@StatusOfMarkout WHERE TicketFileName=@TicketFileName" dim SqlCon as New SqlConnection(serverStuff) dim SqlCmd as new SqlCommand(sSqlCmd, SqlCon) If Flag1List.SelectedItem.Value = "No Change" Then    SqlCmd.Parameters.Add(new SqlParameter("@Flag1", SqlDbType.NVarChar,35))    SqlCmd.Parameters("@Flag1").Value = PreviousMarkoutStatus.Text    SqlCmd.Parameters.Add(new SqlParameter("@CompleteDate", SqlDbType.DateTime, 8))    SqlCmd.Parameters("@CompleteDate").Value = CompDateElse   SqlCmd.Parameters.Add(new SqlParameter("@Flag1", SqlDbType.NVarChar,35))    SqlCmd.Parameters("@Flag1").Value = CurrentStatus.Text    SqlCmd.Parameters.Add(new SqlParameter("@CompleteDate", SqlDbType.DateTime, 8))    SqlCmd.Parameters("@CompleteDate").Value = Today()End IfSqlCon.Open() SqlCmd.ExecuteNonQuery() SqlCon.Close()</code>Can anybody help me with this?  Thanks a bunch

View 7 Replies View Related

Error Updating DB2 On MVS-MF From A Linked Server

Apr 30, 2007

Need to be able to run update queries on DB2 on IBM MF from a Linked Server. Select and Insert queries work but Update and Delete queries don't. DB2 connect is installed and ODBC System dsn's are created for DEV and Production DB2 environments.



The ODBC drivers can be selected when running Imports/Exports but can't be specified through a linked server.



Any Ideas??



Tom...

View 1 Replies View Related

Error When Updating Bigint Columns Using ADO

May 3, 2007

I am attempting to write a conversion of our product for Compact Edition; we already provide it based on SQL Server. The database interface uses ADO through a Python-win32com adaptor, and has worked fine so far. (Note: *not* ADO.net, just plain old COM)

Now, a curious thing happens. When inserting new data through a Recordset, everything works fine - except for columns defined as bigint. There are no exceptions thrown, but when you read the columns back they contain nothing but zeroes. Do the same to any other column type - I've tried integer, numeric, float, nvarchar and ntext so far, and they all seem to work just fine. It does not seem to be conversion-related either, since I've tested the exact same data to various column types. And using bigint on regular SQL Server works just fine.

The code involved is quite unspectacular, and simply switching the column types to integer would solve the immediate problem, but causes potential future issues since we normally store internal IDs in bigint columns, and the values may grow quite large.

View 1 Replies View Related

Error In Updating Field Thru Stor_proc

Jul 13, 2007



I'm trying to update 'password' field in a table thru a stored procedure which is called from my program.

I'm passing the values for password and the key fields.

While debugging I can see the values in each parameter, but I get an error that the 'value for password was not passed'.

Here's the program snippet for calling the stored proc.

All three parameters are 'varchar' type

---------------------------------------------------------------------------

dbConn.Open();

dbConn.CreateParameters(3);

dbConn.AddParameters(0, Pwd, newPwd);

dbConn.AddParameters(1, Login, pwd_Login);

dbConn.AddParameters(2, IdNum, pwd_IdNum);

result = dbMgr.ExecuteNonQuery(CommandType.StoredProcedure, SP_UPDPWD);

--------------------------------------------------------------------------------------------

EXEC @return_value = [dbo].[usp_UsrMstUpdPwdParaPwdEmailCaseNum]

@Pwd = N'3Sg7vqowIBRdfgdfgrgdjykFTjTFt5hfHfhFtFghzIG1haWRliBuYW1lPw==',

@Login = N'xyz@abc.com',

@IdNumber = N'00009'



--------------------------------------------------------------------------------------------

What am I missing?

View 3 Replies View Related

Error Updating Installed Files

Apr 30, 2006

Well I need to know HOW TO REMOVE MANUALLY every pieace of the Database Services for my SQL Server Express CTP previous installation because the final release won't let me update this Database Services, any suggestion besides removing manually the services? thank you all

View 5 Replies View Related

Updating A Large Set Of Data

Oct 4, 2006

hello guyshere is my problem:i am developing a asp.net web app in .net 2.0. i have some sensitive data in my database. which is encrypted using DES ( with some key which is only known by the top level authorities ). now there is an option of changing the secret key. on changing the key the sensitive data has to decrypted using the old key and then again encrypted using the new key. Now if the no of records increases i am afraid that it might take a longer time and the application might look as it got hanged. guys i have no clue on how to do this. if you guys have any idea on how to implement this please let me know. any help would be appreciatedVignesh

View 7 Replies View Related

Sql Data Source Updating

Mar 19, 2007

hello all,
 I ran into a problem using the "sql data source updating " method. i'm using a form view with about 20 parameters that are bind to controls in the form view and 5 other parameters that i'm setting the value to in the "sql data source updating" method. Every thing updates find execept for the last 5 parameters that i'm setting the values to in the "sql data source updating" method. My store procedure(sp) updates and insert mulitple tables. For some UNKOWN reason the tables that uses the parameteres in the "sql data source updating " are inserting multple records when only 1 record should be inserted. Have anyone have this problem?

View 1 Replies View Related

Updating Data In Two Tables

May 25, 2008

 I have a database which is used for the asp.net login control and i use the same database for my website work too. In this database there are asp.net created tables for login controls and the tables that i have created for the website. Now when i add a user to the website, data is added in the asp.net created tables (like aspnet_membership, aspnet_users). I want to add  some of the data that is added to these tables into the tables that i have created. Is there a way i can do this?

View 4 Replies View Related

Getting, Editing And Updating Data

Feb 20, 2004

Hi,

I want to get (SELECT??) data from a db (SQL), edit the data (+1) and then update (UPDATE??) the table with the edited value. How do I get the value from the db and then edit it and then update the field in the db?? Does someone has an example so I get on the way??

Thanks,

Roel

View 9 Replies View Related

Updating Data From Excel

Feb 18, 2002

Hello, I am a relatively new user to SQL so forgive me if the solution is not very dificult :) I have a SQL database that contains a products table that includes part numbers with part descriptions. I need to change all the part descriptions (over 6000 records) so I exported the table into Excel. All the changes have been done in Excel but i am having problems trying to re-import the new data into the existing table. Any info would be appreciated. Thanks

View 4 Replies View Related

Updating Data From One Table To Another

Apr 19, 2006

I am relatively new to SQL and am having trouble with an update. I know I cannot use a join update and have to use subquery. I am not sure of the syntax on how to do this. Below is basically what I want to do, but cannot figure out how to do it with a subquery. Any help would be appreciated.

update revisedapps
set alternateapp = t.alternateapp
from tempalternateapps t
join revisedapps r on t.appname = r.softwarename

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved