Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Sunday, March 25, 2012

Cannot drop article ''TABLE60'' from publication ''DB_Comp''...

[ Merge Replication ]
I work with a software that the act deletion and creation of the table
and deletion and creation and change of the field by the users happens
so much.
for deletion of the table using this command :
sp_dropmergearticle @.publication='DB_Doc',
@.article = 'TABLE65',
@.force_invalidate_snapshot=1
, but after execute this command displayed below message :
"Cannot drop article 'TABLE65' from publication 'DB_Doc' because its
snapshot has been run and this publication could have active
subscriptions."
how can i drop the table in active merge replication with T-SQL(System
Stored Procedure)?
thanks.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
As far as I know, you can't. The best you can do is synchronize all
subscribers until no change is applied, drop the publication, change the
table on the publisher and subscribers, readd the publication and do a
nosync initialization.
Rgds,
Paul Ibison

Cannot divide

I'm having a real hard time with a division in my table. It is in a field in a group that I have no problem getting the correct result by these expressions:
=SUM(Fields!NrOfOptysTotal.Value + Fields!NrOfActivities.Value) or
=SUM(Fields!NrOfOptysTotal.Value - Fields!NrOfActivities.Value)
But if I do this:
=SUM(Fields!NrOfOptysTotal.Value / Fields!NrOfActivities.Value) or
=SUM(Fields!NrOfOptysTotal.Value * Fields!NrOfActivities.Value)
,I don't get the correct results, I only get Infinity or NaN, but I shouldn't. I have tried manipulating the expressions like
=SUM(Fields!NrOfOptysTotal.Value) / SUM(Fields!NrOfActivities.Value) and several other combinations, but it never works. I really don't understand the problem! Please help...Somehow I got it to work now with
=SUM(Fields!NrOfOptysTotal.Value) / SUM(Fields!NrOfActivities.Value)
I'm SURE I tried that before, I don't get it, but whatever...
"FredrikT" wrote:
> I'm having a real hard time with a division in my table. It is in a field in a group that I have no problem getting the correct result by these expressions:
> =SUM(Fields!NrOfOptysTotal.Value + Fields!NrOfActivities.Value) or
> =SUM(Fields!NrOfOptysTotal.Value - Fields!NrOfActivities.Value)
> But if I do this:
> =SUM(Fields!NrOfOptysTotal.Value / Fields!NrOfActivities.Value) or
> =SUM(Fields!NrOfOptysTotal.Value * Fields!NrOfActivities.Value)
> ,I don't get the correct results, I only get Infinity or NaN, but I shouldn't. I have tried manipulating the expressions like
> =SUM(Fields!NrOfOptysTotal.Value) / SUM(Fields!NrOfActivities.Value) and several other combinations, but it never works. I really don't understand the problem! Please help...
>

Thursday, March 8, 2012

Cannot create a row of size 8075 which is greater than... (-214721

Hello all,
I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box that
sometimes fails when trying to update an ADO field type of adLongVarChar
(stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
mode) and produces the following error:
Error Number: -21472179
Error Description: Cannot create a row of size 8075 which is greater than
the allowable maximum of 8060.
The error seems to be occurring when we try to update the field with a large
string value. The strange thing is that it works without producing an error
sometimes. The reason I say this is that I can see some entries in my table
that have a DATALENGTH of the text field much larger than some of the ones
that are failing.
My VB6/ADO code looks like so:
'inserts a new record into a table with default values
sql = "call mydatadatable_insert "
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
myID= objRecordset.Fields.Item("ID").Value
objRecordset.Close
Set objRecordset = Nothing
'loads a 23 KB xml file
sXML = ReadFile("c:\temp\test.xml")
'...more processing here (non database)
sql = "exec mydatadatable_update" & cstr(myID)
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
'this is the problem area!!
objRecordset.Fields("FileTxt").Value = sXML
objRecordset.Update
objRecordset.Close
Set objRecordset = Nothing
I was thinking it might have something to do with the reference to ADO 2.5,
rather than 2.8 which is what comes with Windows Server 2003. But again, it
seems to be working some of the time.
I found this article on Microsoft's site:
http://msdn.microsoft.com/library/d...serr_1_20hd.asp
Any help would be greatly appreciated!!!
Thanks in advance!
Brian McCulloughHi,
After reading your post I have one question.
Is XML file always the same size?
My opinion is that sometimes XML file (or string) is small enough to fit
into varchar (which I think you're using for data-type) and sometimes it os
too large (8075).
You could generaly solve the problem with using text or ntext as a datatype
in the affected column.
Danijel
"brianpmccullough" <bmccullough11@.comcast.net> wrote in message
news:593E87AE-3407-4ACB-9908-7F5A8969EAB8@.microsoft.com...
> Hello all,
> I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box
> that
> sometimes fails when trying to update an ADO field type of adLongVarChar
> (stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
> mode) and produces the following error:
> Error Number: -21472179
> Error Description: Cannot create a row of size 8075 which is greater than
> the allowable maximum of 8060.
> The error seems to be occurring when we try to update the field with a
> large
> string value. The strange thing is that it works without producing an
> error
> sometimes. The reason I say this is that I can see some entries in my
> table
> that have a DATALENGTH of the text field much larger than some of the ones
> that are failing.
> My VB6/ADO code looks like so:
> 'inserts a new record into a table with default values
> sql = "call mydatadatable_insert "
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> myID= objRecordset.Fields.Item("ID").Value
> objRecordset.Close
> Set objRecordset = Nothing
> 'loads a 23 KB xml file
> sXML = ReadFile("c:\temp\test.xml")
> '...more processing here (non database)
> sql = "exec mydatadatable_update" & cstr(myID)
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> 'this is the problem area!!
> objRecordset.Fields("FileTxt").Value = sXML
> objRecordset.Update
> objRecordset.Close
> Set objRecordset = Nothing
>
> I was thinking it might have something to do with the reference to ADO
> 2.5,
> rather than 2.8 which is what comes with Windows Server 2003. But again,
> it
> seems to be working some of the time.
> I found this article on Microsoft's site:
> http://msdn.microsoft.com/library/d...serr_1_20hd.asp
> Any help would be greatly appreciated!!!
> Thanks in advance!
> Brian McCullough

Cannot create a row of size 8075 which is greater than... (-214721

Hello all,
I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box that
sometimes fails when trying to update an ADO field type of adLongVarChar
(stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
mode) and produces the following error:
Error Number: -21472179
Error Description: Cannot create a row of size 8075 which is greater than
the allowable maximum of 8060.
The error seems to be occurring when we try to update the field with a large
string value. The strange thing is that it works without producing an error
sometimes. The reason I say this is that I can see some entries in my table
that have a DATALENGTH of the text field much larger than some of the ones
that are failing.
My VB6/ADO code looks like so:
'inserts a new record into a table with default values
sql = "call mydatadatable_insert "
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
myID= objRecordset.Fields.Item("ID").Value
objRecordset.Close
Set objRecordset = Nothing
'loads a 23 KB xml file
sXML = ReadFile("c:\temp\test.xml")
'...more processing here (non database)
sql = "exec mydatadatable_update" & cstr(myID)
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
'this is the problem area!!
objRecordset.Fields("FileTxt").Value = sXML
objRecordset.Update
objRecordset.Close
Set objRecordset = Nothing
I was thinking it might have something to do with the reference to ADO 2.5,
rather than 2.8 which is what comes with Windows Server 2003. But again, it
seems to be working some of the time.
I found this article on Microsoft's site:
http://msdn.microsoft.com/library/de...err_1_20hd.asp
Any help would be greatly appreciated!!!
Thanks in advance!
Brian McCullough
Hi,
After reading your post I have one question.
Is XML file always the same size?
My opinion is that sometimes XML file (or string) is small enough to fit
into varchar (which I think you're using for data-type) and sometimes it os
too large (8075).
You could generaly solve the problem with using text or ntext as a datatype
in the affected column.
Danijel
"brianpmccullough" <bmccullough11@.comcast.net> wrote in message
news:593E87AE-3407-4ACB-9908-7F5A8969EAB8@.microsoft.com...
> Hello all,
> I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box
> that
> sometimes fails when trying to update an ADO field type of adLongVarChar
> (stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
> mode) and produces the following error:
> Error Number: -21472179
> Error Description: Cannot create a row of size 8075 which is greater than
> the allowable maximum of 8060.
> The error seems to be occurring when we try to update the field with a
> large
> string value. The strange thing is that it works without producing an
> error
> sometimes. The reason I say this is that I can see some entries in my
> table
> that have a DATALENGTH of the text field much larger than some of the ones
> that are failing.
> My VB6/ADO code looks like so:
> 'inserts a new record into a table with default values
> sql = "call mydatadatable_insert "
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> myID= objRecordset.Fields.Item("ID").Value
> objRecordset.Close
> Set objRecordset = Nothing
> 'loads a 23 KB xml file
> sXML = ReadFile("c:\temp\test.xml")
> '...more processing here (non database)
> sql = "exec mydatadatable_update" & cstr(myID)
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> 'this is the problem area!!
> objRecordset.Fields("FileTxt").Value = sXML
> objRecordset.Update
> objRecordset.Close
> Set objRecordset = Nothing
>
> I was thinking it might have something to do with the reference to ADO
> 2.5,
> rather than 2.8 which is what comes with Windows Server 2003. But again,
> it
> seems to be working some of the time.
> I found this article on Microsoft's site:
> http://msdn.microsoft.com/library/de...err_1_20hd.asp
> Any help would be greatly appreciated!!!
> Thanks in advance!
> Brian McCullough

Wednesday, March 7, 2012

Cannot convert to decimal

I have a money field in SQL that when i try and get the sum of it i cannot convert it to decimal. This was working now its not, and nothing was changed.

Any reason for the error?

DECLARE @.TEST decimal(10,2)
SET @.Test = (SELECT SUM(INV_Net) FROM abc.dbo.iSplit_Details WHERE LoanID='0000010604')
Print @.Test

RETURNS: 160471.24
----------------------------------------------------

Specified cast is not valid.

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.InvalidCastException: Specified cast is not valid.

Source Error:

Line 3576: // CURRENT TOTAL
Line 3577: cmd.CommandText = "SELECT SUM(INV_Net) FROM abc.dbo.iSplit_Details WHERE LoanID=@.LoanID";
Line 3578: decimal split_currentamt = ((decimal)cmd.ExecuteScalar());

Check if you have NULLs. Its a good idea to set a default of 0 for these type of columns to avoid errors like these.

SELECT SUM(ISNULL(INV_Net,0)) FROM abc.dbo.iSplit_Details WHERE LoanID='0000010604'

|||

that was good information to know, i can use that in a lot of other spots. Thanks

but im still getting the same error.

|||

Was the error at the front end (converting the value to decimal) or at the backend? IF you run the query in query analyzer do you see any errors?

|||

when i run it in query analyzer it works.

|||Oh ok. It wasnt clear if it was a front end issue or a back end one. Can you create a new post again in WebForms section? Sorry for the inconvenience. I dont code in .NET so I may not be able to help you there.|||If you are formatting your currency column in your front end, you may need to strip out the dollar sign($) before you send it back to your database.