Showing posts with label record. Show all posts
Showing posts with label record. Show all posts

Friday, March 23, 2012

Invalid object name 'dbo.MSreplication_queue'.

I am attemption to update a record in a SQL 2005 table that is trans.
replicated with updates and I am receiving the following message...
Msg 208, Level 16, State 1, Procedure sp_MSsendtosqlqueue, Line 40
Invalid object name 'dbo.MSreplication_queue'.
Any ideas?
AHIA,
Larry...
Does the table dbo.MSreplication_queue exist in the subscribing database ?
In updatable scription scenerio, SQL Server fires ins/upd/del triggers which
will insert information into that table when a DML command is executed on the
replicated tables. So this table is one of the critical tables for the queue
replication to work.
I can think of only 2 reasons why you might be running into this error :
1. The table dbo.MSreplication_queue has been deleted. To see if the table
was dropped, take a look at the default trace report for the database "Schema
Changes Histroy" in the Management Studio.
or
2. The snapshot did not get applied to the subscriber successfully. Check
the distribution agents histroy to see if there has been any failures.
"LPR-3rd" wrote:

> I am attemption to update a record in a SQL 2005 table that is trans.
> replicated with updates and I am receiving the following message...
> Msg 208, Level 16, State 1, Procedure sp_MSsendtosqlqueue, Line 40
> Invalid object name 'dbo.MSreplication_queue'.
>
> Any ideas?
> AHIA,
> Larry...
>
|||What is the compatibility level of this database?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"LPR-3rd" <lreames@.gmail.com> wrote in message
news:1168541651.977581.286190@.i56g2000hsf.googlegr oups.com...
>I am attemption to update a record in a SQL 2005 table that is trans.
> replicated with updates and I am receiving the following message...
> Msg 208, Level 16, State 1, Procedure sp_MSsendtosqlqueue, Line 40
> Invalid object name 'dbo.MSreplication_queue'.
>
> Any ideas?
> AHIA,
> Larry...
>

Friday, March 9, 2012

invalid character value on 7000th record

Our developers are trying to pinpoint why a function keeps bombing out
(email below). The database was created using the same setup as other
dbs, none of which have had this problem. I ran a trace, which showed
several Sort Warnings before the process stopped, but no error
messages. The process seems to be a complex query for data, which is
then loaded into a table.
Any suggestions?
I am trying to debug a problem with some data conversion (from a dbf
file into a SQL table) For some reason we get this once we have loaded
our 7000th record. It is not a problem with the record, not always the
same one, has something to do with the limit. Not sure why 7000, but
always crashes there. I have tried everything on the code side.
Is there any setting in SQL that my enforce some limits on data loading
or on the store call, maybe something odd with this table?
"Underlying DBMS error[Microsoft OLE DB Provider for SQL Server:
Invalid character value for cast specification. (.dbo.a109)]"hi,
If you try to move that table using an ETL tool as DTS, inside the pump you
can define how many error as maximum you want to pass.
"naomi" wrote:

> Our developers are trying to pinpoint why a function keeps bombing out
> (email below). The database was created using the same setup as other
> dbs, none of which have had this problem. I ran a trace, which showed
> several Sort Warnings before the process stopped, but no error
> messages. The process seems to be a complex query for data, which is
> then loaded into a table.
> Any suggestions?
>
> I am trying to debug a problem with some data conversion (from a dbf
> file into a SQL table) For some reason we get this once we have loaded
> our 7000th record. It is not a problem with the record, not always the
> same one, has something to do with the limit. Not sure why 7000, but
> always crashes there. I have tried everything on the code side.
> Is there any setting in SQL that my enforce some limits on data loading
> or on the store call, maybe something odd with this table?
> "Underlying DBMS error[Microsoft OLE DB Provider for SQL Server:
> Invalid character value for cast specification. (.dbo.a109)]"
>

Invalid character value for cast specification error

I'm using Access 2K via ODBC to replicated SQL Server 2K. In some tables (not all) when I try to add a record either with a form or directly in the datasheet I get this error message and all form controls/table cells display '#Name?'. The record is added
and displays correctly if I close and reopen the form/table. I can add records with no problem in Enterprise Manager.
Any help gratefully received.
Jonathan Attree
Hi, I am getting exactly the same problem although this problem has only occurred since I implemented merge replication. Does anyone have an answer?
Amanda

Wednesday, March 7, 2012

Invalid attempt to read when no data is present using SQLdatareader

I'm trying to determine if the record is NULL/empty or is valid from the datareader.

objReader = strCMD.ExecuteReader
objReader.Read()
if objReader.IsDBNull(0) = true then...

If NULL/Empty, display no records found. If records are found, display "1 or more records have been found". I keep getting the error "Invalid attempt to read when no data is present". I'm not sure what I am doing wrong here.Do While objReader.Read()
' your code.
Loop|||Use the HasRows property of a DataReader:

objReader = strCMD.ExecuteReader
If objReader.HasRows() Then
' Display 1 or more rows found
Else
' Display no rows found
End If

The reason your code was failing was because the "objReader.Read()" line attempts to access the next element in the DataReader, and so if it's empty then it becomes an invalid access, like trying to access one more index past the end of an array. If all you need is whether or not the DataReader contains any information, then HasRows is your easiest bet.|||And if what you need to do is access the info datareader contains, and are getting this error, and have a do while loop, what's the next thing to try?|||Look at why the SQL isn't returning anything!

Invalid attempt to read when no data is present

I am using a standard dbreader type of loop in a query to retrieve data. I am running over what should be end of record set, every time.

I have altered my read procedures to use while dbreader.read() and if dbreader.read(), to attempt to avoid getting the error. Neither is stopping it.

While debugging it, as I get to the last item and actually get the error, if I check the dbreader status, it still indicates that it has rows.

Anyone have any ideas on how to get around this?

TIA, Tom

Can you post your code?
|||

Sure can. The below posted is the whole thing. The sqlcommand, connection, etc. should be irrelavant.

' get the data from the database and pass it back.

Function getTheData(ByVal cmd As String) As DataTable

' note that the passed cmd is the below sqlString

Dim sqlString As String = "SELECT CONVERT(char(20), Date, 107) AS Date, City, State, Company, Position, JobNumber, Row_Number() Over (ORDER BY JobNumber DESC) as Item FROM JobsDB "

' define the new datatable to hold our results

dt = New DataTable("Jobs")

' define the columns we will be saving

Dim dcIt As New DataColumn("Item", GetType(String))

Dim dcDt As New DataColumn("Date", GetType(String))

Dim dcCt As New DataColumn("City", GetType(String))

Dim dcSt As New DataColumn("State", GetType(String))

Dim dcJN As New DataColumn("JobNumber", GetType(Integer))

Dim dcKW As New DataColumn("KeyWords", GetType(String))

Dim dcPos As New DataColumn("Position", GetType(String))

Dim dcCo As New DataColumn("Company", GetType(String))

' add columns

dt.Columns.Add(dcIt)

dt.Columns.Add(dcDt)

dt.Columns.Add(dcCt)

dt.Columns.Add(dcSt)

dt.Columns.Add(dcJN)

dt.Columns.Add(dcKW)

dt.Columns.Add(dcPos)

dt.Columns.Add(dcCo)

' define datarow

Dim dr As DataRow

' build sql command info

sqlCmd = New SqlCommand

sqlCmd.Connection = sqlConn

sqlCmd.CommandType = CommandType.Text

sqlCmd.CommandText = sqlString

Try

sqlConn.Open()

dbReader = sqlCmd.ExecuteReader()

If dbReader.HasRows Then

While dbReader.Read() 'this can be changed to if dbreader.read(), no diff

' build the data table item from the database

dr = dt.NewRow()

dr("Item") = dbReader.Item("Item").ToString()

dr("Date") = dbReader.Item("Date").ToString()

dr("City") = dbReader.Item("City").ToString()

dr("State") = dbReader.Item("State").ToString()

dr("JobNumber") = dbReader.Item("JobNumber").ToString()

dr("Position") = dbReader.Item("Position").ToString()

dr("Company") = dbReader.Item("Company").ToString()

dr("KeyWords") = keywords

dt.Rows.Add(dr)

End While

Else

lblNoData.Visible = True

End If

Catch ex As Exception

Dim exMsg As String = Request.ServerVariables("Script_Name") + ", getTheData(cmd=" & sqlString & "): msg=" + ex.Message.ToString()

utils.writeApplicationLog(exMsg, System.Configuration.ConfigurationManager.AppSettings("UtilityDbName"))

Response.Redirect(ConfigurationManager.AppSettings("errorPage") & ConfigurationManager.AppSettings("errCatchAll") & "&return=" & Request.ServerVariables("Script_Host"))

End Try

Return dt.Copy

End Function

Thanks, Tom

|||The code worked for me using sample data.

Some thoughts: Make the declarations of sqlConn, sqlCmd, and dbReader local to the function instead of global. Add a Finally section that contains dbReader.Close, sqlConn.Close, and sqlConn.Dispose.

If that doesn't change anything, is it possible that there's something in your data that is causing the problem?