I'm getting a strange error.
I have created a Datatable and in this table I have multiple Columns.
I have given them all a name and now when I want to put data in the DataTable I get a error.
All goes well until I try to Update the Datatable
During merge replication initialization from SQL Server 2005 to SQL Server CE 3.5 on Windows Mobile 5.0
I am getting the following errors:
On Device {"The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 21,Table name = COLLECTION ]"} base {System.SystemException}: {"The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 21,Table name = COLLECTION ]"} HResult: -2147217900 Message: "The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 21,Table name = COLLECTION ]" NativeError: 26100 Source: "Microsoft SQL Server Compact"
{System.Data.SqlServerCe.SqlCeError: The SQL statement failed to execute. If this occurred while using merge replication, this is an internal error. If this occurred while using RDA, then the SQL statement is invalid either on the PULL statement or on the SubmitSQL statement. [ SQL statement = ALTER TABLE [dbo].[COLLECTION] ADD CONSTRAINT [PK_COLLECTION] PRIMARY KEY CLUSTERED ( [SERIAL_NUMBER], [STORE_CODE], [COLLECT_DATE] )WITH PAD_INDEX , FILLFACTOR = 90 ]} Source: "Microsoft SQL Server Compact"
Server Logged: ... 2008/04/20 20:03:16 Thread=EA0 RSCB=5 Command=SCHK Hr=00000000 SyncCheck responding 0 2008/04/20 20:03:17 Thread=B90 RSCB=5 Command=OPNR Hr=00000000 End Of Data Set 1 2008/04/20 20:03:17 Thread=B90 RSCB=5 Command=OPNR Hr=00000000 Responding to Fetch, bytes = 50259 2008/04/20 20:03:17 Thread=970 RSCB=5 Command=CLOS Hr=00000000 Total Compressed bytes out = 50259 2008/04/20 20:03:17 Thread=970 RSCB=5 Command=CLOS Hr=00000000 Total Uncompressed bytes out = 390254 2008/04/20 20:03:17 Thread=970 RSCB=5 Command=CLOS Hr=00000000 Removing this RSCB 0 2008/04/20 20:03:19 Hr=00000000 Compression Level set to 1 2008/04/20 20:03:19 Hr=80004005 ACK:Error for DistributorSessionID = 80 2008/04/20 20:03:19 Hr=80004005 The SQL statement failed to execute. If this occurred while using merge replication, this is an internal error. If this occurred while using RDA, then the SQL statement is invalid either on the PULL statement or on the SubmitSQL statement. [,,,SQL stateme 28560
The same tables in a different on a different SQL box (test) replicate fine, but on this box (production) they do not. Any idea what would be the difference in the two environments?
I suspect that the "dbo." part in the "alter table" is what it is messing up on... how can I tell SQL CE not to include that schema prefix? Thanks
I have inherited a database that has a column defined as bit. Looking at BOL it shows the valid values are 0,1, null. However there are several rows of data which have -1. Is BOL wrong? we think a VB program runs an update which changes this.
I'm importing data from and oracle database to an SQL one through a SSIS package, I'm getting this error: "The output column "earned_hours" has a precision that is not valid. The precision must be between 1 and 38". the package runs but returns this column as NULL values
earned_hours is of type "NUMBER" in oracle (some of the values are decimals), I tried making it numeric(x,y),float or decimal(x,y), but I'm still getting the same results.
does anybody know why is this happening or have a solution for this error?
I'm in the middle of developing some database independent code and I am surprised to find that the SqlCeException inherits from System.Exception not DbException. The argument I have seen is that DbException does not exist in the CE framework which I understand but this clearly breaks the model laid out by the other assemblies in the data namespace.
My issue is that I have a library which accepts an object implementing the IDBCommand. The execute command is wrapped in a try catch which is only interested in a DbException and allows all other exceptions through which therefore will allow and SqlCeException through.
I have three options available to me:
Catch all exceptions - This is not acceptable as other exceptions need to bubble up to the calling code.
Explicitly catch an SqlCeException - This too is not acceptable as it is a common library and not every application wants a reference to the SqlCe assembly
Explicitly catch an SqlCeException outside of the method call - As hideous as it is this is the only viable solution available to me meaning that any calling code using an SqlCeCommand must be aware of this "feature". If anyone else has a suggestion I am willing to listen otherwise I'm going to go back to banging my head against the wall.</rant>
Cannot use dynamic sql in current context. So need some help regarding this.I am developing a stored procedure to update a table. Sending Column names as parameters, but not able to use them as given below.INSERT INTO Books (@Column1, @Column2) values.. Any way to execute without using dynamic sql?..Thanx.
after migration my project to CF 3.5 and SQlCe 3.5 I got the following error message:
System.Data.SqlServerCe.SqlCeException - A parameter is missing. [ Parameter ordinal = 1 ]
I'm using the same code:
Public Sub Update(oSqlCEConn As SqlCeConnection, oSqlCEAdapter As SqlCeDataAdapter, dt As DataTable) ... Dim cmd As SqlCeCommand = New SqlServerCe.SqlCeCommand cmd.Connection = oSqlCEConn cmd.IndexName="UK_IVCTAMOBILE" cmd.CommandText="INSERT INTO IVCTAMOBILE(PKey,Status,Dfu,Lu,BusinessModified,BusinessModified_T,IvcTAMetaPKey,InitiationDate,IvcMainPKey,Accounted,Amount,SdoMainPKey,BpaMainPKey,PaymentMethod,InitiationDate_T) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" oSqlCEAdapter.InsertCommand=cmd oSqlCEAdapter.Update(dt) ... End Sub
I migrated the Database with this program:
Public Sub Upgrade(DB) Dim sPath As String Dim engine As System.Data.SqlServerCe.SqlCeEngine sPath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase sPath = sPath.Substring(0, sPath.LastIndexOf("")) engine = New System.Data.SqlServerCe.SqlCeEngine("Data Source=" & sPath & "Test.sdf") engine.Upgrade() MsgBox("Finished") End Sub
I am getting the above error if i try to access sqlce3.0 database from an application which already uses sqlce2.0, this error happens while initializing the sqlcecommand object I hope the reason might be executing the the sqlcecommand through a sqlce2.0 engine on a sqlce3.0 database,
But I tried installing the sqlce3.0 in the PDA , still I am getting the same error
I was trying to get my data from olb table to excel. but i got this error my dataflow is as follows: oledb source-> excel destination
i have got a excel file template at the destination all ready. with the column names+ the sheet all ready. but somehow it got stuck... anybody can help? thanks!
Exception from HRESULT: 0xC0204018 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------ BUTTONS:
OK ------------------------------ For most of my queries to Oracle I can cast the columns to get rid of the error (CAST x AS DECIMAL(10) etc), but this does not work for:
1) Union
I have a select like "SELECT NVL(myColumn, 0) .... FROM myTable UNION SELECT 0 AS myColumn, .... FROM DUAL"
Even if I cast the columns in both selects (SELECT CAST(NVL(myColumn, 0) AS DECIMAL(10, 0) .... UNION SELECT CAST(0 AS DECIMAL(10, 0)) AS myColumn, .... FROM DUAL) I still get the error above.
2) SQL command from variable
The select basically looks like this:
"SELECT Column1, Column2, ... FROM myTable WHERE Updated BETWEEN User::LastLoad AND User::CurrentLoad"
Again, even if I cast all columns (like in the union), I still get the same error.
I want to have this query insert a bunch of XML but i get this error...
Msg 128, Level 15, State 1, Procedure InsertTimeCard, Line 117
The name "ExpenseRptID" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
Msg 128, Level 15, State 1, Procedure InsertTimeCard, Line 151
The name "DateWorked" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
What am i doing wrong...Can anyone help me out!! Thanks!!
p.s I know this query looks crazy...
Code Block
IF EXISTS (SELECT NAME FROM sysobjects WHERE NAME = 'InsertTimeCard' AND type = 'P' AND uid=(Select uid from sysusers where name=current_user)) BEGIN DROP PROCEDURE InsertTimeCard END go /********************************************************************************************************* ** PROC NAME : InsertTimeCardHoursWorked ** ** AUTHOR : Demetrius Powers ** ** TODO/ISSUES ** ------------------------------------------------------------------------------------ ** ** ** MODIFICATIONS ** ------------------------------------------------------------------------------------ ** Name Date Comment ** ------------------------------------------------------------------------------------ ** Powers 12/11/2007 -Initial Creation *********************************************************************************************************/ CREATE PROCEDURE InsertTimeCard @DateCreated DateTime, @EmployeeID int, @DateEntered DateTime, @SerializedXML text, @Result int output as declare @NewTimeCardID int select @NewTimeCardID = max(TimeCardID) from OPS_TimeCards -- proc settings SET NOCOUNT ON
-- local variables DECLARE @intDoc int DECLARE @bolOpen bit SET @bolOpen = 0 --Prepare the XML document to be loaded EXEC sp_xml_preparedocument @intDoc OUTPUT, @SerializedXML -- check for error IF @@ERROR <> 0 GOTO ErrorHandler --The document was prepared so set the boolean indicator so we know to close it if an error occurs. SET @bolOpen = 1
--Create temp variable to store values inthe XML document DECLARE @tempXMLTimeCardExpense TABLE ( TimeCardExpenseID int not null identity(1,1), TimeCardID int, ExpenseRptID int, ExpenseDate datetime, ProjectID int, ExpenseDescription nvarchar(510), ExpenseAmount money, ExpenseCodeID int, AttachedRct bit, SubmittoExpRep bit ) DECLARE @tempXMLTimeCardWorked TABLE ( TimeCardDetailID int not null identity(1,1), TimeCardID int, DateWorked DateTime, ProjectID int, WorkDescription nvarchar(510), BillableHours float, BillingRate money, WorkCodeID int, Location nvarchar(50) ) -- begin trans BEGIN TRANSACTION insert OPS_TimeCards(NewTimeCardID, DateCreated, EmployeeID, DateEntered, Paid) values (@NewTimeCardID, @DateCreated, @EmployeeID, @DateEntered, 0) -- check for error IF @@ERROR <> 0 GOTO ErrorHandler
--Now use @intDoc with XPATH style queries on the XML INSERT @tempXMLTimeCardExpense (TimeCardID, ExpenseRptID, ExpenseDate, ProjectID, ExpenseDescription, ExpenseAmount, ExpenseCodeID, AttachedRct, SubmittoExpRep) SELECT @NewTimeCardID, ExpenseRptID, ExpenseDate, ProjectID, ExpenseDescription, ExpenseAmount, ExpenseCodeID, AttachedRct, SubmittoExpRep FROM OPENXML(@intDoc, '/ArrayOfTimeCardExpense/TimeCardExpense', 2) WITH ( ExpenseRptID int 'ExpenseRptID', ExpenseDate datetime 'ExpenseDate', ProjectID int 'ProjectID', ExpenseDescription nvarchar(510) 'ExpenseDescription', ExpenseAmount money 'ExpenseAmount', ExpenseCodeID int 'ExpenseCodeID', AttachedRct bit 'AttachedRct', SubmittoExpRep bit 'SubmittoExpRep') -- check for error IF @@ERROR <> 0 GOTO ErrorHandler
-- remove XML doc from memory EXEC sp_xml_removedocument @intDoc SET @bolOpen = 0
-- commit transaction, and exit COMMIT TRANSACTION set @Result = @NewTimeCardID RETURN 0
-- Error Handler ErrorHandler: -- see if transaction is open IF @@TRANCOUNT > 0 BEGIN -- rollback tran ROLLBACK TRANSACTION END -- set failure values SET @Result = -1 RETURN -1
hello,everybody ,i use the AnalysisServicesExecuteDDLTask ,but it dap an error "DDL is not valid",i don't konw what is the problem and how to solve?thank you!
im doing a sum on a table and it either returns a number in decimal format or 'null' . The problem is when it returns null i want it to just make the text say '0.00'. So i did a test on the object that if it returns NULL just print '0.00' but if it is not null it tells me that there is a number there and i want to store that as a decimal and print it out. But i get an error for a type cast when im not it should not even be going to that part of the code. In the code below the first executescaler will return null so it should just go straight to the else. But it gives me the type cast error in the if that shouldnt be seen. The error and code are below. //Borrower NSF FEES cmd.CommandText = "select sum(itemamount) from postmtdtls where loanid='" + LoanID + "' and Transactioncode = '310'"; object temp = cmd.ExecuteScalar(); if (temp != null) { decimal B_NSFFees = ((decimal)cmd.ExecuteScalar()); borrowerPayoff_NSFFees.Text = String.Format("{0:#,#.##}", B_NSFFees).ToString(); //Borrower NSF FEES } else { borrowerPayoff_NSFFees.Text = "0.00"; //borrowerPayoff_NSFFees.Text = "0.00"; } Server Error in '/WebSite5' Application. 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 774: if (temp != null) Line 775: { Line 776: decimal B_NSFFees = ((decimal)cmd.ExecuteScalar()); Line 777: borrowerPayoff_NSFFees.Text = String.Format("{0:#,#.##}", B_NSFFees).ToString(); //Borrower NSF FEES Line 778: }Source File: c:ProgrammingFilesWebSite5InvestorPool.aspx.cs Line: 776 Stack Trace: [InvalidCastException: Specified cast is not valid.] InvestorPool.GetLoanInfo(String LoanID) in c:ProgrammingFilesWebSite5InvestorPool.aspx.cs:776 InvestorPool.MortAccountText(Object sender, EventArgs e) in c:ProgrammingFilesWebSite5InvestorPool.aspx.cs:660 System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +75 System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +124 System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +7 System.Web.UI.Page.RaiseChangedEvents() +138 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4507 Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
I'm trying to install MSDE SP3 which I downloaded from MS at http://www.asp.net/msde/. Following the instructions as best I can I unzipped the file into a Folder now called MSDE located on C: I then went to a command prompt and typed in the command given to start the install:
setup SAPWD=testsite SecurityMode=SQL
Hit enter and the installer started up and ran for a few secs and then came back with
The Instance named specified is invalid
There was no mention of including an instance name or the format for it.
Suggestions please?
Also, if I want to completly uninstall MSDE if I need to how would I do it?
Can't seem to find why I'm getting this error: Specified cast is not valid. Ok, using a stored procedure for SQL Server 2000 and here is the main part of it: SELECT id, rank, firstName, lastName, service, status, createdTime FROM accessRequest WHERE lastName LIKE @tLastName AND firstName LIKE @tFirstName And the C# code behind from the class file: SqlDataReader spResults; conn.Open(); spResults = command.ExecuteReader(); while( spResults.Read() ) { AccessRequestSearch request = new AccessRequestSearch( (int)spResults.GetInt32( 0 ), spResults.GetString( 2 ), spResults.GetString( 3 ), spResults.GetString( 1 ), spResults.GetString( 4 ), spResults.GetString( 5 ), Convert.ToDateTime(spResults.GetString( 6 ))); searchResults.Add( request ); // Add to Array List } spResults.Close(); The part in red is where I think it's happening because that is what I just added to the request. createdTime in the table is set as DateTime. Can anyone see what I am missing here? More info is available if needed. Thanks, Zath
I have a question regarding the backup to use in case of consistency errors.
I'm backing up my dbs daily and logs hourly with 'verify the integrity of the backup when completed' checked. Today I found out one of my tables has 1 page id error (dbcc checkdb message from yesterday), I'm wondering if I can use yesterday's full backup even if it's done after the dbcc, that way I don't have to apply a lot less log backups. In other words, does or does not the full backup inherit the corruption if it is done after consistency errors and the backup passes the integrity verification.
I'm having this really strange issue with mirroring.
I've followed the instructions on http://msdn2.microsoft.com/en-us/library/ms191140.aspx to the letter, leaving out the witness server part, as I don't have one.
All works OK, but when activating the mirroring on the principal server I get the usual error 1418 error. I fired up SQL Server Profiler to see what was happening, and the following error emerged.
Connection handshake failed. The certificate used by the peer is invalid due to the following reason: Certificate not yet valid. State 104.
I do not know what I did wrong. I tested a simple function in my custom code and get the error saying "Character is not valid". Any help is appreciated!
Here is the function inside my custom code.
Shared Function test() As string
Dim items As Fields Return items("DataField1").Value;
End Function
I call the function in the body of my report using: Code.test()
and the error says "There is an error on line 18 of custom code: [BC30037] Character is not valid."
I get this error in a package which was executing previously. This is in SQLServer OLEDB DATASOURCE Error at Membership_Other_Payer [DTS.Pipeline]: The index is not valid.
ADDITIONAL INFORMATION: Exception from HRESULT: 0xC0048004 (Microsoft.SqlServer.DTSPipelineWrap) This error occurs when I try to open my existing Oledb datasource. I have added some columns in my database Any body has solution for this?
I've build a website with asp.net and on my local machine it run very we. but when I store my website on a server, I have a error : ...error: 25 - Connection String not valid... This is my connection string on my local machine : "add name="csIyp" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" " And the connection string on my webserver : "add name="csIyp" connectionString="data source= .MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" " So, what can I do to solve this probleme. Thanks !
what i want to achive is the proc sh'd return a master-detail value in one go. master value should be returned with Out Parameter and detail value as a recordset.
will it return the recordset of detail table as below....
SELECT @ProductCode = ProductCode, @ProductName = ProductName, @CategoryID = CategoryID, @CategoryName = (select CategoryName from mCategory where CategoryID=a.CategoryID), @Image1 = isnull(Image1,''), @Image2 = isnull(Image1,''), @UnitPrice = isnull(UnitPrice,0), @UOMValue = isnull(UOMValue,0), @UOMName = isnull(UOMName,''), @ShippingWeight = isnull(ShippingWeight,0), @Directions = isnull(Directions,''), @Ingrediants = isnull(Ingrediants,''), @Warnings = isnull(Warnings,''), @ShortDescription = isnull(ShortDesc,''), @LongDescription = isnull(LongDesc,''), @NutritionFacts = isnull(NutritionFacts,''), @SearchKeywords = isnull(SearchKeywords,''), @IsTaxable = case when isnull(IsTaxable,0)=0 then 'No' else 'Yes' End, @CreatedBy = isnull((select LName + ',' + FName from mUser where UserID=InsertedBy),''), @CreatedOn = InsertedOn, @UpdatedBy = isnull((select LName + ',' + FName from mUser where UserID=UpdatedBy),''), @UpdatedOn = UpdatedOn, @Status = Convert(int,isnull(Status,0)) FROM mProduct a WHERE ProductID = @ProductID
SELECT ID as PricingDetailID, isnull(PricingFromQnty,0) as PricingFromQnty, isnull(PricingToQnty,0) as PricingToQnty, isnull(RangePrice,0) as RangePrice, Convert(int,isnull(Status,0))as Status FROM dProduct WHERE ProductID = @CategoryID
GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
Here's my code: Dim Cmd as New SQLCommand(sqlString, conn) cmd.CommandType=CommandType.StoredProcedure Breaks Here ----->>cmd.parameters.add(New SQLParameter(@OrdAlias, OrdNum)) cmd.parameters.add(New SQLParameter(@AliasSourceCode, 4))The error says:compilation error - - then, on the line that is in red:Compiler Error Message: BC30037: Character is not valid.I have 'OrdNum' declared globally, and OrdNum is assigned right away in the Page_Load event. I've checked the spelling of the SQL parameters (OrdAlias is a varchar, and AliasSourceCode is a tinyInt)After all this - then, this code runsAny ideas why I'm getting this error??
all schedulled task on server failed for 18450 Process Exit Code 1. ...t Utility, Version 6.50.240 Copyright (C) Microsoft Corporation, 1995 - 1996 [Microsoft SQL-DMO] Error 18450: [SQL Server] Login failed- User: sqlexec Reason: Not defined as a valid user of a trusted SQL Server connection. Any information on how to solve it
I've got a linked server setup to DB2, and some of the date fields in the DB contain 1/1/0001 values.
I've got views created in SQL2000 against the DB2 linked server.
When I run a query against a particular table that contains multiple field of datetime type.
I get the below error Server: Msg 8114, Level 16, State 8, Line 1 Error converting data type DBTYPE_DBTIMESTAMP to datetime.
This only happens when I include in the select the field that contains 1/1/0001 values.
I assume since valid dates ranges in SQL are from January 1, 1753 through December 31, 9999, this would be what's causing this.
I tried to covert in the select but that failed as well. The only thing that I've been able to do, is to use a DTS to pull the data from the DB2 to a local SQL2000 table, with that fields type set as varchar. This works.
Using a DTS to pull the data to a local table in production isn't a viable workaround, since this table contains 1.8 million rows.
How is DTS converting this field, when convert fails in the select?
I've just set up a maintenance plan that backs up all user databases daily and logs hourly. I've just noticed that the plan history is giving the following error -
Database 'BizTalkEDIDb' is not valid to be included in the maintenance plan.
Has anyone seen this before or know how to resolve it?
New to SQL Server installations. I downloaded the SQL Server Express with Advanced; when I double click the Setup.exe, I get a pop-up "document path/file is not a valid Win32 application". I upgraded from XP Home to XP Pro SP2.0. Any suggestions?