Wednesday, March 28, 2012
problem with bigints in SS 2000
"Server: Msg 3624, Level 20, State 1, Line 1
Location: p:\sql\ntdbms\storeng\drs\include\record.inl:1447
Expression: m_SizeRec > 0 && m_SizeRec <= MAXDATAROW
SPID: 111
Process ID: 2028
Connection Broken"
I have a RESTORED database with about 10 large tables. A simple select
would return a couple of thousand of rows and then suddenly bomb out with
the above error. Interestingly the problem occurs only on the tables that
contain bigint columns, so I'm not sure if it's related. If I run "dbcc
checktable" on these table it returns lots of errors. I'm pretty sure the
database is not corrupt - it happens on any number of machines, plus the
database works fine at its original location. When I try to repair the
restored tables using "checktable" I can only do so with
"repair_allow_data_loss", not a good option of course. Also I have to
remove any indexes I have on the bigint columns. Any ideas?
Thanks
Have you tried using checktable with Repair_Rebuild. If that does not work then I would try deleting the indexes and rechecking then.
Jeff
MCDBA, MCSE+I
|||Hi,
Thanks for the reply. Yes, I have tried that, but it doesn't work - it only
works with "repair_allow_data_loss". Most of the errors are "consistency"
errors. It seems to me the problem lies with the bigint fields, but I'm not
sure why. I'm pretty sure the problem is not related to the indexes,
because only two of the problem tables have indexes. If I drop the indexes,
some of the errors (like "missing parents") go away, but the "consistency"
ones remain.
Tnx,
Pieter
"Jeff Duncan" <jduncan@.gtefcu.org> wrote in message
news:100C38FB-3B9B-43F6-8700-DECF9E014C74@.microsoft.com...
> Have you tried using checktable with Repair_Rebuild. If that does not
work then I would try deleting the indexes and rechecking then.
> Jeff
> MCDBA, MCSE+I
problem with bigints in SS 2000
"Server: Msg 3624, Level 20, State 1, Line 1
Location: p:\sql\ntdbms\storeng\drs\include\record.inl:1447
Expression: m_SizeRec > 0 && m_SizeRec <= MAXDATAROW
SPID: 111
Process ID: 2028
Connection Broken"
I have a RESTORED database with about 10 large tables. A simple select
would return a couple of thousand of rows and then suddenly bomb out with
the above error. Interestingly the problem occurs only on the tables that
contain bigint columns, so I'm not sure if it's related. If I run "dbcc
checktable" on these table it returns lots of errors. I'm pretty sure the
database is not corrupt - it happens on any number of machines, plus the
database works fine at its original location. When I try to repair the
restored tables using "checktable" I can only do so with
"repair_allow_data_loss", not a good option of course. Also I have to
remove any indexes I have on the bigint columns. Any ideas?
ThanksHi,
Thanks for the reply. Yes, I have tried that, but it doesn't work - it only
works with "repair_allow_data_loss". Most of the errors are "consistency"
errors. It seems to me the problem lies with the bigint fields, but I'm not
sure why. I'm pretty sure the problem is not related to the indexes,
because only two of the problem tables have indexes. If I drop the indexes,
some of the errors (like "missing parents") go away, but the "consistency"
ones remain.
Tnx,
Pieter
"Jeff Duncan" <jduncan@.gtefcu.org> wrote in message
news:100C38FB-3B9B-43F6-8700-DECF9E014C74@.microsoft.com...
> Have you tried using checktable with Repair_Rebuild. If that does not
work then I would try deleting the indexes and rechecking then.
> Jeff
> MCDBA, MCSE+I
problem with bigints in SS 2000
"Server: Msg 3624, Level 20, State 1, Line 1
Location: p:\sql\ntdbms\storeng\drs\include\record
.inl:1447
Expression: m_SizeRec > 0 && m_SizeRec <= MAXDATAROW
SPID: 111
Process ID: 2028
Connection Broken"
I have a RESTORED database with about 10 large tables. A simple select
would return a couple of thousand of rows and then suddenly bomb out with
the above error. Interestingly the problem occurs only on the tables that
contain bigint columns, so I'm not sure if it's related. If I run "dbcc
checktable" on these table it returns lots of errors. I'm pretty sure the
database is not corrupt - it happens on any number of machines, plus the
database works fine at its original location. When I try to repair the
restored tables using "checktable" I can only do so with
"repair_allow_data_loss", not a good option of course. Also I have to
remove any indexes I have on the bigint columns. Any ideas?
ThanksHave you tried using checktable with Repair_Rebuild. If that does not work
then I would try deleting the indexes and rechecking then.
Jeff
MCDBA, MCSE+I|||Hi,
Thanks for the reply. Yes, I have tried that, but it doesn't work - it only
works with "repair_allow_data_loss". Most of the errors are "consistency"
errors. It seems to me the problem lies with the bigint fields, but I'm not
sure why. I'm pretty sure the problem is not related to the indexes,
because only two of the problem tables have indexes. If I drop the indexes,
some of the errors (like "missing parents") go away, but the "consistency"
ones remain.
Tnx,
Pieter
"Jeff Duncan" <jduncan@.gtefcu.org> wrote in message
news:100C38FB-3B9B-43F6-8700-DECF9E014C74@.microsoft.com...
> Have you tried using checktable with Repair_Rebuild. If that does not
work then I would try deleting the indexes and rechecking then.
> Jeff
> MCDBA, MCSE+I
Friday, March 23, 2012
Problem with AddNew on SQL server in c++ 2003
table. If the table is not empty, it is OK. Any one has clue for this proble
m?
Thanks!
Cwang
"roberta.coffman@.emersonprocess.com" wrote:
> Hello,
> I created a very simple database with only one table (Records) and on
> that table only one column (Category datatype nvarchar).
> I am trying to use the AddNew ado example found on msnd but it always
> inserts a null value instead of the value I am trying to insert.
> All my HRESULTs say S_OK but the CategoryStatus is alway 3 (which is
> null).
> I am using UNICODE.
> I can insert records just fine if I use the INSERT INTO command but I
> am not having any luck with the AddNew API.
> Can anyone help?
> Here is my code:
> class CJournalRecord :public CADORecordBinding
> {
> BEGIN_ADO_BINDING(CJournalRecord)
> ADO_VARIABLE_LENGTH_ENTRY2(1, adVarChar, Category, sizeof(Category),
> CategoryStatus, TRUE)
> END_ADO_BINDING()
> public:
> CString Category;
> ULONG CategoryStatus;
> };
> HRESULT hr = S_OK;
> _RecordsetPtr pRstEvents = NULL;
> IADORecordBinding *picRs = NULL;
> hr = pRstEvents.CreateInstance(__uuidof(Recordset));
> if (hr != S_OK)
> {
> }
> else
> {
> //the connection is already open
> CJournalRecord newEvent;
> hr = pRstEvents->Open(_T("Records"),_variant_t((IDispatch *)
> connection, true),adOpenKeyset,adLockOptimistic,adCm
dTable);
> //Open an IADORecordBinding interface pointer which we'll use for
> Binding Recordset to a class
> hr =
> pRstEvents-> QueryInterface(__uuidof(IADORecordBindin
g),(LPVOID*)&picRs);
> hr = picRs->BindToRecordset(&newEvent);
> newEvent.Category = _T("SeeYou");
> newEvent.CategoryStatus = adFldNull;
> if(hr!=S_OK)
> {
> }
> else
> {
> hr = picRs->AddNew(&newEvent);
> int status = (int)newEvent.CategoryStatus;
> //hr = pRstEvents->Update();
> }
> }
>Hi
My problem was when the recordset was instantated by a strored Proc or a
oCmdLExecute it was read only and would not Update() or Addnew() at anytime.
I instantate the RS using a text string now
When wise men disapprove, that's bad;
when fools applaud, that's worse.
A Spanish proverb
John Linville
"CWang" <CWang@.discussions.microsoft.com> wrote in message
news:F60BE31E-F792-4B7F-9AC9-FD3B9EAD563D@.microsoft.com...
>I encounter the similar problem, which cannot add new record into an empty
> table. If the table is not empty, it is OK. Any one has clue for this
> problem?
> Thanks!
> Cwang
> "roberta.coffman@.emersonprocess.com" wrote:
>
Problem with adding record into database
What's the problem?
Sub submitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'If Page.IsValid Then
Try
Dim MySQL = "addCustomerSQL"
Dim cmd As New SQLCommand("addCustomerSQL", dbConn)
cmd.Commandtype() = CommandType.StoredProcedure
cmd.Parameters().Item("@.username").Value = userText.Text
cmd.Parameters.Item("@.password").Value = passText.Text
dbConn.Open()
cmd.ExecuteNonQuery()
dbConn.Close()
Catch ex As Exception
End Try
End SubMake sure you're importing System.Data.SqlClient in your class|||Where would I put that?|||At the top of your page type this
Imports System.Data.SqlClient
Public Class......|||To follow up, I was able to get the code to compile, but nothing is being transferred to the database table after clicking submit.
Private Sub submitButton_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs)'If Page.IsValid
Try
Dim MySQL = "addCustomerSQL"
Dim dbConn As New System.Data.SqlClient.SqlConnection
Dim cmd As New SqlCommand("addCustomerSQL", dbConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New SqlParameter("@.username", KuserTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.password", KpassTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.fullname", KfnameTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.email_address", KemailTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.phone_nbr", KphoneTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.mailing_address", KaddressTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.credit_card_name", KccNameTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.credit_card_nbr", KccNumTextLI.Text))
cmd.Parameters.Add(New SqlParameter("@.credit_card_expiry_date", KccExpTextLI.Text))
cmd.Parameters.Item("@.username").Value = KuserTextLI.Text
cmd.Parameters.Item("@.password").Value = KpassTextLI.Text
cmd.Parameters.Item("@.fullname").Value = KfnameTextLI.Text
cmd.Parameters.Item("@.email_address").Value = KemailTextLI.Text
cmd.Parameters.Item("@.phone_nbr").Value = KphoneTextLI.Text
cmd.Parameters.Item("@.mailing_address").Value = KaddressTextLI.Text
cmd.Parameters.Item("@.credit_card_name").Value = KccNameTextLI.Text
cmd.Parameters.Item("@.credit_card_nbr").Value = KccNumTextLI.Text
cmd.Parameters.Item("@.credit_card_expiry_date").Value = KccExpTextLI.Text
dbConn.Open()
cmd.ExecuteNonQuery()
dbConn.Close()
Response.Redirect("http://localhost/KevinLiu/thankyou.aspx")Catch ex As Exception
End Try
End Sub
Is there anything I need to put under the Page_Load procedure? Or how about on my html page, do I have to call the event procedure from there?
The Database tables were created first in a .sql file, so is it necessary to include the attributes in my Parameters.Add lines?|||Hi,
im not sure... but i think that the main problem would be the parameter name must be the same as the input variable name in your stored procedure.
anyway your codes are somewhat redundant. The following 2 lines are doing the same thing.
cmd.Parameters.Add(New SqlParameter("@.username", KuserTextLI.Text))
cmd.Parameters.Item("@.username").Value = KuserTextLI.Text
this would be enought if you are adding a sql parameter of type VarChar in:
cmd.Parameters.add(new sqlparameter("@.username", kusertextLi.text))
and this would give you a sql parameter of type Numeric :
cmd.Parameters.add(new sqlparameter("@.age", cint(kagetextLi.text))
note that if your stored procedure has output variables you have to specify the direction of the parameters. Example:
dim param as new sqlparameter("@.username", kusertextLi.text))
param.direction = parameterdirection.input
Friday, March 9, 2012
problem when deleting record in table
but sometimes it takes very long time and sometimes just like hang, the
status is
"Executing Query Batch"
why could this happen?HI,
Use
TRUNCATE TABLE <table name>
to delete all records in a table.
Thanks
Hari
SQL Server MVP
"chin_yen83" <chin_yen83@.yahoo.com> wrote in message
news:1124938782.400433.251690@.o13g2000cwo.googlegroups.com...
>I tried to delete all record in Table X
> but sometimes it takes very long time and sometimes just like hang, the
> status is
> "Executing Query Batch"
> why could this happen?
>