Sp_create_trace Throws Errorcode = 12

Nov 6, 2007

Hi,

I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?

If it helps I added script which I tried to execute:

-- Create a Queue
declare @rc int
declare @TraceID int
declare @maxfilesize bigint
set @maxfilesize = 5

exec @rc = sp_trace_create @TraceID output, 0, N'C:Profiler_result
esult.trc', @maxfilesize, NULL
if (@rc != 0) goto error

-- Client side File and Table cannot be scripted

-- Set the events
declare @on bit
set @on = 1
exec sp_trace_setevent @TraceID, 10, 1, @on
/*here are n-setevents*/
exec sp_trace_setevent @TraceID, 43, 35, @on

-- Set the Filters
declare @intfilter int
declare @bigintfilter bigint

exec sp_trace_setfilter @TraceID, 1, 1, 6, N'history'
exec sp_trace_setfilter @TraceID, 1, 1, 6, N'move_history'
exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Profiler'
exec sp_trace_setfilter @TraceID, 35, 1, 6, N'kis'


-- Set the trace status to start
exec sp_trace_setstatus @TraceID, 1

-- display trace id for future references
select TraceID=@TraceID
goto finish

error:
select ErrorCode=@rc

finish:
go


Thanks in advance for any advice
Regards,
Bartolo

View 3 Replies


ADVERTISEMENT

ErrorCode 14

Sep 15, 2006

I've scripted a sql trace for Sql Server 2000 and added the filename in the appropreate location andthe result is a column called ErrorCode with a value of 14. Can anyone tell me what this error code means and what could be infered about what I need to resolve it?

Thanks,
Marc

View 1 Replies View Related

OleDbException ErrorCode

Feb 26, 2007

When a user finally confirms his order in a shopping cart application (using MS-Access as the backend), the items he has purchased are populated in a Access DB table named Orders & his personal details (like name, mail, billing address, shipping address etc.) are populated in another table named CustDetails. Both the DB tables have a column named OrderID. This column is the Primary Key in the CustDetails table & the Foreign Key in the Orders table. The Session.SessionID becomes the unique OrderID.After confirming an order, if the user refreshes the page, the app will try to populate the same Session.SessionID in the CustDetails table but since the column OrderID is a Primary Key column in the table CustDetails, it won't accept duplicate OrderIDs. Under such circumstances, an OleDbException will be raised.Since a DB app can throw other OleDbExceptions other than the one about which I mentioned above, I want to display custom error messages to the user. For e.g. if he refreshes the page after confirming his order, I want to display a message saying "Your order has already been placed".To do this, I tried using the ErrorCode property of the OleDbException class but what I found is the ErrorCode changes from time to time! Had a particular ErrorCode been assigned to the error, I could have done something like this (assuming that the ErrorCode for the above error is -12345 which is constant):Try    'some codeCatch ex As OleDbException    If (ex.ErrorCode = -12345) Then        Response.Write("Your order has already been placed")    ElseIf (ex.ErrorCode = <some other constant ErrorCode>) Then        Response.Write("Another custom error message")    End IfEnd TryBut I can't do the above since the ErrorCode changes from time to time.So how do I display custom error messages to users under such circumstances?Of course, I can use the Message property of the OleDbException class but that would be a rather tedious workaround.

View 4 Replies View Related

ErrorCode 8144

Jun 14, 2008

Hi,
In my local , application is working fyn...but when i had uploaded in the file in Live and executed the SP's ,It is showing up the error 8144...
Whene i had checked in google it is showing:
has too many arguments specified: Msg 8144....But i had not passed to many arguments...
(The same SP is working in local but not in live)...
The related files also i had shifted to live...

This is the SP I Have used....
while Submiting iam getting error
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO



--- STORED PROCEDURE USP_CREATE_USER TO SAVE THE APPLICATION INFORMATION INTO DATABASE


CREATE PROCEDURE dbo.USP_CREATE_APPLICATION_ONLINE
(

@ApplicationID INT,
@Broker CHAR(1),
@Name VARCHAR(30),
@Phone VARCHAR(15),
@Email VARCHAR(50),
@LoanAmount Decimal(9),
@LoanPurpose VARCHAR(200),
@DeedType_ID VARCHAR(50),
@SubDeedType_ID INT,
@DeedAddress VARCHAR(200),
@City VARCHAR(50),
@CountryID INT,
--@StateID INT,
@MarketValue Decimal(9),
@LoanTerm INT,
@Appraised CHAR(3),
@Comments VARCHAR(50),
@DeleteFlag VARCHAR(1),
@RETURN int OUT,
@ERRORCODE int OUT
)

AS
set @RETURN=1
SET NOCOUNT ON


iF EXISTS(SELECT * FROM APPLICATION_ONLINE WHERE ApplicationID=@ApplicationID)
Begin
BEGIN TRANSACTION TRANSUPDATE
UPDATE APPLICATION_ONLINE SET

ApplicationID = @ApplicationID,
Broker = @Broker,
[Name] = @Name,
Phone = @Phone,
Email = @Email,
LoanAmount=@LoanAmount,
LoanPurpose=@LoanPurpose,
DeedType_ID=@DeedType_ID,
SubDeedType_ID=@SubDeedType_ID,
DeedAddress =@DeedAddress,
City =@City,
CountryID = @CountryID,
MarketValue = @MarketValue,
LoanTerm = @LoanTerm,
Appraised =@Appraised,
Comments =@Comments

WHERE [ApplicationID] = @ApplicationID

SET @ERRORCODE=@@ERROR
IF @ERRORCODE <> 0
BEGIN
ROLLBACK TRANSACTION TRANSUPDATE
SET @ERRORCODE=@@ERROR
RETURN
END
ELSE
BEGIN
COMMIT TRANSACTION TRANSUPDATE
SET @ERRORCODE=50002
RETURN
END

END

else

BEGIN
BEGIN TRANSACTION TRANSINSERT
INSERT INTO APPLICATION_ONLINE(
ApplicationID,
Broker,
[Name],
Phone,
Email,
LoanAmount,
LoanPurpose,
DeedType_ID,
SubDeedType_ID,
DeedAddress,
City,
CountryID,
-- StateID,
MarketValue,
LoanTerm,
Appraised ,
Comments,
DeleteFlag
)
VALUES
(
@ApplicationID,
@Broker,
@Name,
@Phone,
@Email,
@LoanAmount,
@LoanPurpose,
@DeedType_ID,
@SubDeedType_ID,
@DeedAddress,
@City,
@CountryID,
-- @StateID,
@MarketValue,
@LoanTerm,
@Appraised,
@Comments,
@DeleteFlag

)

SET @ERRORCODE=@@ERROR
IF @ERRORCODE <> 0
BEGIN
ROLLBACK TRANSACTION TRANSINSERT
SET @ERRORCODE=50004
RETURN
END
ELSE
BEGIN
COMMIT TRANSACTION TRANSINSERT
SET @ERRORCODE=50001
RETURN

END

END



GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

Thanks

View 3 Replies View Related

ErrorCode Description

Dec 11, 2007



This is a request to the Microsoft SSIS staff.
I did a search for the keywords in the description and can already see a lot of people frustrated about this.

A lot of well designed integration packages will route error messages to an error table or file.
SSIS appends a couple of extra error columns called ErrorCode and ErrorColumn. At runtime, an extra
column is visible in the DataViewer called ErrorCode - Description.

The description is hardcoded into the dtsmsg.h file in the SDK folder of Sql Server.
This file is very hard to parse.

Can some from SSIS please post an XML or CSV file with all the error codes and descriptions for us to download please.
This will be such a big help in debugging.

Many Thanks.


Shailen Sukul
Software Architect/Developer/Consultant
(BSc | Mcts (Biztalk (IP)) | Mcpd | Mcts (Web, Win, Dist Apps) | Mcsd.NET | Mcsd | Mcad)
Ashlen Consulting Services Pty Ltd
(http://www.ashlen.com.au)
MSN | Skype | GTalk Id: shailensukul
Ph: +61 0421 277 812
Fax: +61 3 9011 9732
Linked In: http://www.linkedin.com/in/shailensukul

View 3 Replies View Related

How Do You Make Use Of ErrorCode And ErrorColumn

Feb 1, 2007



SSIS automatically adds the columns ErrorCode and ErrorColumn to the error pipe routing bad rows. However, both these columns appear to be meaningless. We need to translate the error column to the actual problem column and the error code to a meaningful error. ErrorColumn is the more important issue for us. The question is 'Are these just useless columns? If not, how do we translate them into something useful?'

Thanks

View 1 Replies View Related

SQL Express ERRORCODE:37000

Dec 27, 2007

Installed SQL express 2005 w/Studio Manager. Everything installed Ok except got an error IIS was not running or not installed.
When installing a software program, when it tries to create the database I get an error at the initialization:

An error has occured while processing an SQL statement. Please refer to the system administrator guide for further assistance.
ERRORCODE:37000
ERROR:CREATE DATABASE failed. Some of the file names cound not be created. Check related errors.
SQL STATEMENT
CREATE DATABASE xxxx


Has anyone seen or know a fix for this? Thanks in advance.

View 1 Replies View Related

Problem With ErrorCode (DT_NTEXT Not Supported...???)

Jul 21, 2006

Hi again!

I have another problem, this time with a flatfile source component. The file is pretty simple organized and in fact everything works as expected.

The file itself comes from an FTP server, so it is not available at designtime. For setting up the flatfile source i downloaded it, but afterwards i delete it, set 'dalayvalidation' to true and try to execute.

FTP download works fine, the file is there but then i get the errormessage:

Copier ErrorCodes [586]: The data type for "output column "Flat File Source Error Output Column" (610)" is DT_NTEXT, which is not supported with ANSI files. Use DT_TEXT instead and convert the data to DT_NTEXT using the data conversion component.



When i try to set the datatype of the Error Output Column (610) to DT_NEXT i only get an errormessage telling me that this would not be a valid value for this property.

The only chance i have to get it working again is to completely delete the flatfile-source, readd and setup it again, then everything works... but only until i remove the files and try to download them via FTP. It's strange :-( and annoying.

Anyone any idea?

kind regards,

Wolfgang

View 1 Replies View Related

SSIS : ErrorCode OnInformation EventHandler

Feb 18, 2008

Hello,

Within my SSIS packages I use a logging logic quite similar as the one described by Jamie Thomson here : http://blogs.conchango.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx

But I still have a small "problem". When my package end with success the ErrorCode returned at the OnInformation event handler level is :







0x4001100B


1073811467


DTS_I_COMMITTINGTRANSACTION


Committing distributed transaction started by this container.

Instead of :







0x40013001


1073819649


DTS_MSG_PACKAGESUCCESS


Package "__" finished successfully.

Another example.

When there's an integrity constraint violation, I've got the following ErrorCode returned :







0xC0047021


-1073450975


DTS_E_THREADFAILED


Thread "__" has exited with error code __.

Instead of :







0xC020907D


-1071607683


DTS_E_OLEDBDESTINATIONADAPTERSTATIC_INTEGRITYVIOLATION


The data value violates integrity constraints.

Anyone has a clue ?

Thanks a lot by advance.

Cheers,

Bertrand

View 6 Replies View Related

Copy Database Wizard ErrorCode=-1073548784

Sep 13, 2007



I am transfering a database from sql server 2000 to sql server 2005 using copy database wizard.
I have this error coming up error

Error: ERROR : errorCode=-1073548784 description=Executing the query "EXEC dbo.sp_grantdbaccess @loginame = N'Testusername', @name_in_db = N'username' " failed with the following error: "The login already has an account under a different user name.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC} StackTrace: at Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer() at Microsoft.SqlServer.Management.Smo.Transfer.TransferData() at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()

How do i handle this error...looked online but didn't find right answers...

Please let me know

View 2 Replies View Related

Decoding Decimal Form Of HRESULT From ErrorCode

Mar 2, 2006

I have an OLE-DB Command transformation that inserts a row. If the insert SQL command fails for some reason, I use the "Redirect Row" option to send the row to another OLE-DB Command transformation that logs the error on that row to a "failed rows" table. In this table I log the ErrorCode and ErrorColumn values that come with the error path from the first OLE-DB Command.

OK, that's all working great. However, here's the kicker: there's no error description value. The ErrorCode value, naturally, is the decimal form of an HRESULT--for example, -1071607696. Without some further information, however, this code is not useful for troubleshooting.

Has anyone figured out a trick here? I'm not even certain that this is an SSIS HRESULT, since it could for all I know be from the OLE-DB layer, the database layer, or somewhere else.

Thanks,
Dan

View 7 Replies View Related

Kirk: Importing/Exporting With Column ErrorCode, ErrorColumns

Mar 8, 2006

I am currently redirecting lookup failures into error tables with ErrorCode and ErrorColumn. It works fine until I want to transfer data into the archived database. The SSIS pacakage generate by SQL Exporting tool is throwing an "duplicate name of 'output column ErrorCode and ErrorColumn" error. This is caused by oledb source error output. The error output automatically add ErrorCode and ErrorColumn to the error output selection and not happy with it.

I think the question is down to "How to importing/exporting data when table contains ErrorCode or ErrorColumn column?"

View 5 Replies View Related

Best Practices: Recording Error Information (Beyond ErrorCode And ErrorColumn)

Sep 6, 2007

I'm sorry for asking this, as I'm sure tha the answer is in one of the 208 matches I found searching on "ErrorCode". Unfortunately, this project is overdue and I need a solution fairly soon.

I should add that I've only been developing in SSIS since August 2007.

I have a complicated package, loading about 17 outputs of the XML Source into staging tables. I have been using the error outputs of any standard components I use, out of faith that, if Microsoft provided them, then they should be useful for something. I've been directing all of the error outputs for one of the 17 "tables" from the XML Source into a Union All, and then into an "Error staging table", for each of the 17 outputs. This table includes all of the possible columns, but permits nulls for all of them. It also incldues the ErrorCode and ErrorColumn.

Unfortunately, if these latter two are useful for anyting, I haven't found it yet.

Right now, working with our first "mostly real" data, I'm getting 100% of my input rows written into error tables. Unfortunately, the information in the tables are of limited use in determining what went wrong. For instance, the ErrorColumn seems only to be populated if there was a specific error with a specific column. The Lookup component, doesn't seem to populate ErrorColumn, even if only one column was used for the lookup! No information about the component producing the error output is supplied in the error output, either, which makes it difficult to determine which of the five or so possible error outputs is the one that produced the particular error row.

This proves that I'm missing something simple. How do people handle errors? In my custom components, I learned to use the Fire* methods to produce detailed messages before redirecting the row to the error output, but this sort of thing is not available through the standard components.

Do I really have to create a separate "add useful information to the error output" component, and use it on each error output?

Sorry for the attitude, but just when I think I'm winning, SSIS brings me back down to earth!

View 5 Replies View Related

Script Component Throws Error

Jul 18, 2006

Hi,

I have three script component A,B, C. A reads certain data from a table. B inserts records into a .txt file when the recordtype = 1. C inserts records into same .txt file when the recordtype = 0.  Now I receive a script comp error  for C as follows.

[Error Desc]

************************************************************

The process cannot access the file 'D:Documents and SettingsAdministratorDesktopAuditLog.txt' because it is being used by another process.

************************************************************

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)

at System.IO.StreamWriter.CreateFile(String path, Boolean append)

at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)

at System.IO.StreamWriter..ctor(String path, Boolean append)

at ScriptComponent_6bda9d13fce34f90ac6315546c8d0d54.ScriptMain.PreExecute() in dts://Scripts/ScriptComponent_6bda9d13fce34f90ac6315546c8d0d54/ScriptMain:line 19

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PreExecute()

[/Error Desc]

 

Can anyone throw some light on it.

 

Thanks

View 3 Replies View Related

OLE DB Source With Transaction Throws An Error

Mar 18, 2008



Hello,

I have OLE DB Connection to Access database using Jet 4.0 provider.
I have a data flow task in package.
In this data flow task, I have an OLE DB source. This source uses above mentioned connection.

When this data flow task is not a part of transaction, it works fine. But when I set "TransactionOption" property to "Required", the OLE DB source returns following error.
[OLE DB Source [1]] Error: The AcquireConnection method call to the connection manager "databasename" failed with error code 0xC001A004.

I have checked Distributed Transaction Cordinator running. I have some other package running fine which uses transactions but does have OLE DB source.

I have also tried setting "RetainSameConnection" property of a connection to TRUE. But still it is failing.

In short, I am not able to execute OLE DB source in side transaction.

Please guide.

Thanks,

View 3 Replies View Related

DeriveParameters Throws When Called Against A C# Function?

Aug 24, 2006

When I call DeriveParameters against a function written in SQLCLR function it throws an exception. I've been working on this a little while and haven't found a fix. I understand that I could write additional code to do the same work DeriveParameters does, but it seems like this should work.

This is the exception thrown:


[InvalidOperationException: The stored procedure 'GSI.Utils.IsMatch' doesn't exist.]

The function is defined as


CREATE FUNCTION [Utils].[IsMatch](@Value [nvarchar](4000), @RegularExpression [nvarchar](4000))
RETURNS [bit] WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [RegularExpressionsHelper].[UserDefinedFunctions].[IsMatch]

The C# function is defined as:


[Microsoft.SqlServer.Server.SqlFunction(IsDeterministic=true)]
public static SqlBoolean IsMatch(SqlString Value, SqlString RegularExpression)
{
Regex rx = new Regex( RegularExpression.ToString() );
string s = Value.ToString();

return new SqlBoolean(rx.IsMatch(s));
}

This is the code I'm using to call DeriveParameters:


static void Main(string[] args)
{
using (SqlConnection conn = new SqlConnection(m_GetConnectionString()))
{
conn.Open();

SqlCommand myCommand = new SqlCommand("GSI.Utils.IsMatch", conn);
myCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlCommandBuilder.DeriveParameters(myCommand);
}
}

I found that DeriveParameters seems to call sp_procedure_params_managed and when I call it myself it returns the parameters correctly for T-SQL functions, but returns no records when I specify a SQLCLR function.


DECLARE @procedure_name sysname;
DECLARE @group_number int;
DECLARE @procedure_schema sysname;
DECLARE @parameter_name sysname;

SET @procedure_name = 'IsMatch';
SET @group_number = 1;
SET @procedure_schema = 'Utils';
SET @parameter_name = null;

DECLARE @RC int

EXECUTE @RC = [GSI].[Sys].[sp_procedure_params_managed]
@procedure_name
,@group_number
,@procedure_schema
,@parameter_name


I'm able to execute the function without issue and I'm able to use DeriveParameters against everything in the database except C# based functions (and I've tried others besides IsMatch). I'm attempting to run DeriveParameters from a console application and from ASP.NET, both running .NET 2.0.

I've experienced the same behavior in these versions:


SQL Server 2005 Enterprise Edition RTM (MSDN Image on Virtual Server)
SQL Server 2005 Enterprise Edition SP1 (MSDN Image on Virtual Server)
SQL Server 2005 Enterprise Edition SP1 + Hotfix kb918222 (MSDN Image on Virtual Server)
SQL Server 2005 Developer Edition SP1

Has anyone else seen similar behavior?

Any advice would be greatly appreciated -- Thanks

Steve

View 4 Replies View Related

SQL Standard Setup Throws SEHException

Nov 2, 2006

I copied the MSDN setup DVD content to a local drive from USB DVD drive. Started the setup process; accepted the EULA and setup installed the SQL Native Client and Setup Support Files successfully. During System Configuration Checks, the process raises the following dialog:


---------------------------
System.Runtime.InteropServices.SEHException: External component has thrown an exception.

at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)

at System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)

at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)

at System.Windows.Forms.Control.CreateHandle()

at System.Windows.Forms.Control.get_Handle()

at System.Windows.Forms.Control.CreateHandle()

at System.Windows.Forms.TextBoxBase.CreateHandle()

at System.Windows.Forms.Control.get_Handle()

at System.Windows.Forms.Control.CreateGraphicsInternal()

at System.Windows.Forms.Control.CreateGraphics()

at Microsoft.SqlServer.Management.UI.WizardForm.AdjustInfoPanelScrollBar()

at Microsoft.SqlServer.Management.UI.WizardForm.set_InfoText(String value)

at Microsoft.SqlServer.Setup.SetupBootstrapWizard_WizardForm.InitializeComponent()
---------------------------
OK
---------------------------

Any hints?

View 1 Replies View Related

Datareader Object Throws A Non-descript Error.

Mar 4, 2008

I call the datareader using a sqlCommand that I programmatically build and it accesses the database fine.  I can use the exact SQL command that I generate and I can get a result when i run it in SQL Management Studio.  When I run the application and try to access the datareader, it throws an exception whose message is quite frustratingly, <column name>, or in this case "image_URL".  Anyone have any idea what might be causing such an ambiguous error?

View 2 Replies View Related

Connection.ServerVersion Throws System.InvalidOperationException

Mar 17, 2008

I am using VWD2005 and SQLExpress 2005.  In web.config I define the connection:<connectionStrings>
<add name="ProFeeRevenueUser" connectionString="Data Source=.SQLEXPRESS;AttachDBFilename=|DataDirectory|ProFeeRevenue.mdf; Initial Catalog=ProFeeRevenue;User Id=whomever;Password=whatever" providerName="System.Data.SqlClient"/>
When I try this code in a class (util.cs), I get an error on trying to open the connection:System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["ProFeeRevenueUser"].ConnectionString);
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("usp_UserSystemRolesListByUser", cn);System.Data.SqlClient.SqlDataReader dr;
try
{cmd.CommandType = System.Data.CommandType.StoredProcedure;
System.Data.SqlClient.SqlParameter retValParm = cmd.Parameters.Add("@RowCount", System.Data.SqlDbType.Int);retValParm.Direction = System.Data.ParameterDirection.ReturnValue;cmd.Parameters.AddWithValue("@UserLogin", userLogin);
cn.Open();     // error occurs here  <<----------------------------
dr = cmd.ExecuteReader();if (dr.HasRows)
{while (dr.Read() == true)
{string MyRole = dr[1].ToString().Trim();
SystemRoles.Add(MyRole);
}
dr.Close();
}
 It works fine if I point to a SQL server database on my server, but not with SQLExpress, so I assume I have done something wrong with the connection string or the SQL Express database.  Any ideas?

View 2 Replies View Related

ExecuteNonQuery() Throws An Incorrect Syntax Error

Apr 7, 2008

I try to update from datalist by using sqlcommand, it throws an error on the date field:
Mark up:

10/11/2008 12:00:00 AM        <--- the format in the SQL database
Error: 

System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'DOB'.Dim strSQL As String = _
"UPDATE [Customers] SET [country] = @country, " & _"[nickName] = @nickname, [identityid] = @identityid " & _
"[DOB] = @DOB, [Hpno] = @Hpno " & _"[address] = @address, = @email " & _
"WHERE [CustomerID] = @CustomerID"
...Dim parameterdob As SqlParameter = _
New SqlParameter("@DOB", SqlDbType.DateTime)
parameterdob.Value = Request.Form("txtdob") & " 00:00:00"
myCommand.Parameters.Add(parameterdob)
myCommand.ExecuteNonQuery()                                     <---  error here
...
<form id="form1" runat="server">
<asp:DataList ID="ProfileDataList" runat="server">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtdob" Text='<%#DataBinder.Eval(Container.DataItem, "DOB", "{0:d}")%>' />
</ItemTemplate>
</asp:DataList>

View 5 Replies View Related

Update Throws System.FormatException - SQL Server

Dec 16, 2004

I have found out that my UPDATE statement throws an exception : "System.FormatException: Input string was not in a correct format."

For testing purpos I created a simple table in my SQL server containing columns "id" (identity) and "test"(varchar50) and populated 2 rows with data.

SELECTing from the database is ok, so the connection should be fine (connectionstring = server=localhost;database=test;user=sa;)

The update that throws the exception is : "UPDATE test SET test = 'updating' WHERE id = 1"

The same statement is ok in the SQL Query analyser - can anyone help on why this is not the correct format for the UPDATE?

View 3 Replies View Related

What Am I Missing In This Code Which Throws An Exception At Runtime?

Jan 20, 2006

{
//setup the connection and connection string
SqlConnection addTutor = new SqlConnection();
addTutor.ConnectionString = "data source=QUAKEMASTER;" +
"initial catalog=DThomas;uid=sa;password=**********;";
string InsertTutor = "INSERT INTO Tutors (firstname, lastname, tutorID, office)Values(@firstName, @lastName,@tutorID,@location)";
SqlCommand insertTutor = new SqlCommand(InsertTutor);
insertTutor.Connection = addTutor;
//populating an array of sqlParameters performs the same function as an SqlParameters.Add
SqlParameter[] param = new SqlParameter[4];
param[0] = new SqlParameter("@firstName",txtFirstName.Text);
param[1] = new SqlParameter("@lastName",txtLastName.Text);
param[2] = new SqlParameter("@tutorID",int.Parse(txtTutorID.Text));
param[3] = new SqlParameter("@location",listOffice.SelectedItem.ToString());
try
{
//open the connection
addTutor.Open();
//execute the NonSqlQuery
insertTutor.ExecuteNonQuery();
//close the connection
insertTutor.Connection.Close();
}
catch (Exception ThatFeckedUp)
{
throw ThatFeckedUp;
}
finally
{
addTutor.Close();
}

}
 
Sure i've missed something just not sure what.....

View 8 Replies View Related

Group By On The Text Colum Throws Error

Jul 20, 2005

Hi ,I have this querypaprojnumber is varcharpatx500 is textpalineitemseq is intselect Paprojnumber,Patx500,max(palineitemseq) from pa02101,pa01601wherepa02101.pabillnoteidx=pa01601.pabillnoteidx group bypaprojnumber,patx500it throws this errorServer: Msg 306, Level 16, State 2, Line 1The text, ntext, and image data types cannot be compared or sorted,except when using IS NULL or LIKE operator.Thanks a lot for your help.AJ

View 2 Replies View Related

SQL Search :: In DB2 After Concatenation Group By Throws Error

Nov 20, 2015

I have concatenated the two columns in DB2, Concatenation query working fine. I am getting error if I use GROUP BY.

Query:
SELECT
SUM(A)as T
B||'-'|| C as T1
FROM TABLE
GROUP BY T1

Error message:
FROM INTO was not valid. Valid tokens:*N.SQLSTATE:42601,SQLCODE:-104

View 5 Replies View Related

GetDate() Throws Error With MS JDBC Driver V1.2

Oct 24, 2007

Hi,

I have a small program to query a stored procedure in SQL Server 2000 and print out the contents of a returned date field. The program is as follows:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbcqlserver://host:1433;database=db;user=u1;password=p1";
Connection con = DriverManager.getConnection(connectionUrl);
CallableStatement cbstmt = con.prepareCall(" {call stored_proc (?,?)}");

cbstmt.setString(1, "value1");
cbstmt.setString(2, "value2");
ResultSet resultSet = cbstmt.executeQuery();

while (resultSet.next()) {
System.out.println(resultSet.getDate("end_date"));
}

The date field is nullable, and the records in the database are currently null. But when I run this program, I get the following exception when using version 1.2 of the MS JDBC Driver:

com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from int to DATE is unsupported.
at com.microsoft.sqlserver.jdbc.ServerDTVImpl.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.DTV.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.Column.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.Column.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getDate(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getDate(Unknown Source)
at jdbc.main(jdbc.java:38)
Exception in thread "main"

This started happening when we upgraded to the new driver. Any ideas why?

Thanks.

View 1 Replies View Related

Casting Float Output Param Throws An Exception.

Jan 9, 2004

I keep getting an exception when trying to cast an output param as a float type. the SPROC is marked as float OUTPUT and the Cost column in the database is a float type as well. And there are no nulls in the cloumn either. here is how my code looks:


SqlParameter prmCost= new SqlParameter("@Cost", SqlDbType.Float,8);
prmCost.Direction=ParameterDirection.Output;
cmd.Parameters.Add(prmCost);

//...blah blah blah

//invalid cast gets throw on here (it happens with all my float types)
productDetails.Cost=(float)prmCost.Value;




Any suggestions as to what I am doing wrong?

View 3 Replies View Related

SQL Server Column Name Starts With A Number. C# Throws Error.

Mar 21, 2006

I have a table in sql server 2000 which has a column whose name starts with a number("2ndName").I have a c# code which updates the table by filling a Dataset.When I issue an update, it throws the following error:-"Incorrect Syntax near 2"Query I use to build the adapter is "SELECT id, Name, [2ndName] FROM MyTBL WHERE 1 = 3" and the statement issued to update is "objAdapter.Update(objDSDB, "MyTBL")" when it throws the error "Incorrect Syntax near 2".Any help to resolve this is appreciated.Thanks in advance.Jai

View 3 Replies View Related

SQL Server 2012 :: How To Fetch Records Which Throws Error

Feb 27, 2015

How to fetch records which throws error?

For example

I'm inserting records from a table to another table, having multiple columns

SampleQuery :

insert into tableB (col1,col2....col10)
select col1,col2....col10 from tableA

* while executing this query im getting error. (like varchar cant convert to numberic)
* Here I have no clue in which column it is
* also dont know which row causes it

View 3 Replies View Related

Suspect Database - DBCC CHECKDB Throws Error

Apr 13, 2007

Hi all,

we've been having this ancient database with old accounting data running in suspect mode since as long as I can remember (I started working here a year ago), and finally I had some time on my hands so I thought I'd try to get it online again. However I'm running in to problems:

DBCC CHECKDB (myDBName) gives this error:
Msg 926, Level 14, State 1, Line 1
Database 'myDBName' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.

Running sp_helpdb only does not display the suspect database and sp_helpdb 'myDBName' gives this error even though I'm a system administrator:
No permission to access database 'myDBName'.

It's possible that I might be able to dig up a backup but that would be quite tedious. Is it possible to bring the database to a state where I'm able to do a CHECKDB at least...?

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"

View 5 Replies View Related

URGENT: Stored Procedure Throws Windows Error 203

May 15, 2007

I am trying to execute a stored procedure on Server1 which creates an excel report on a share of Server2:

The following error message is thrown:
Saving of scheduled report(s) to Excel file failed : 203 SaveReportToExcel() in TlRptToFile.RptExcel failed in sproc_SaveReportAsFile -
TLRptXL::SaveReportToExcel - Connection to Database failed for Analytics DataBase
Server : TKTALSQL3, Application Server: and DataBase : tlAnalytics : Windows
Error - The system could not find the environment option that was entered.

A DCOM component on Server1 runs the stored procedure that creates the excel report. The account under which DCOM component runs is a member of 'Administrators' group on both Server1 and Server2. Checked permissions on the shares. Account is a local Admin on both Server1 and Server2. Account under which SQLServer and ServerAgent runs is also an Admin on these shares (implicitly as part of 'Administrators' group).

I am manually able to create an excel/text file on the Server2 share while accessing it from Server1, though.

Appreciate your help in resolving the issue.

View 4 Replies View Related

AcquireConnection Throws COMException (0x80131904) In Custom Component

Mar 25, 2007

We have built a custom component that is run in a dataflow contained in a sequence container, which in turn is contained in a loop. Transactions are enabled on the sequence container in such a way that if one step in the loop fails, that step is rolled back but the loop continues. Now, whenever anything happens causing a rollback in one of the iterations, sometimes the call to AcquireConnection in the next iteration will fail with the following error:

Error: 2007-03-25 09:47:31.98
Code: 0xC0047062
Source: KODPLAN Surrogate Key KO_ID [8204]
Description: System.Runtime.InteropServices.COMException (0x80131904): Exception from HRESULT: 0x80131904
at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90.AcquireConnection(Object pTransaction)
at Intellibis.SqlServer.Dts.SurrogateKeyTransform.AcquireConnections(Object transaction)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90wrapper, Object transaction)
End Error

Is there a way to avoid this? It causes that particular iteration to fail as well as the one causing the rollback.

Regards,
Lars

View 5 Replies View Related

Export To Excel Error Throws System.OutOfMemoryException

May 15, 2008

Hi,
My server configuration is
Intel Xeon(R) X5355 @ 2.66GHz, 3.75 GB RAM
Win 2k3

I have been receiving the above mentioned error when I try to use the out of the box feature of "Export To Excel" provided in the Reporting Services, the reports are hosted on MOSS 2007 using the Reporting Services Add-In. The number of pages generated by the report is 500+, so I don't think exporting a report of around 500 - 1000 should give out a memory exception since we have sufficient RAM on the server.


Please advice a solution to solve the error.


Thanks in Advance.

Vikas Mestry.

View 4 Replies View Related

Trigger Throws Exception Error In Great Plains 8.0

Sep 21, 2007

Not sure if there's a GP 8.0 forum, so giving this one a go.



I've added an AFTER UPDATE trigger to the RM00101 table (customer master) in a Great Plains 8.0 SQL Server 2000 SP4 DB. The trigger assigns field values to variables, constructs an update query, and executes the query on a table in a linked SQL Server 2005 DB.

The trigger works fine when fired as a result of a direct field update made through Enterprise Manager. However, when the same update is made through the Great Plains GIU (customer card window), an exception error is thrown:

"Unhandled database exception:
A Save operation on table €˜RM_Customer_MSTR€™ failed accessing SQL data

EXCEPTION_CLASS_DB
DB_ERR_SQL_DATA_ACCESS_ERR€?

The odd thing is that if I drop the trigger from the RM00101 table, the exception error still occurs. Not just on the record originally updated, but on all records and all fields within the record.

Code for the trigger follows:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE TRIGGER CTrig_Logic_Update_Customer
ON RM00101

AFTER UPDATE
AS

IF UPDATE(CUSTNMBR) or
UPDATE(CUSTCLAS) or
UPDATE(CNTCPRSN) or
UPDATE(STMTNAME) or
UPDATE(SHRTNAME) or
UPDATE(TAXSCHID) or
UPDATE(ADDRESS1) or
UPDATE(ADDRESS2) or
UPDATE(ADDRESS3) or
UPDATE(CITY) or
UPDATE(STATE) or
UPDATE(ZIP) or
UPDATE(PHONE1) or
UPDATE(FAX) or
UPDATE(SLPRSNID) or
UPDATE(PYMTRMID) or
UPDATE(PRCLEVEL) or
UPDATE(SALSTERR) or
UPDATE(INACTIVE) or
UPDATE(HOLD) or
UPDATE(CRLMTAMT)

BEGIN

DECLARE @Server_Name Varchar(25),
@Logic_DB_Name Varchar(25),
@SQLStr nvarchar(1000),
@CustomerN int,
@SICCode int,
@ARContact Varchar(35),
@LongName Varchar(50),
@CustomerName Varchar(24),
@SalesTaxCode Int,
@AddrLine1 Varchar(40),
@AddrLine2 Varchar(40),
@AddrLine3 Varchar(40),
@City Varchar(30),
@StateProv Varchar(4),
@PostalCode Varchar(15),
@TelephoneN Varchar(25),
@FaxTelephoneN Varchar(25),
@SalespersonN Int,
@TermsCode Varchar(60), -- Put the customer terms into the CommentN1 field
@CustRateSched Int,
@SalesAreaCode Int,
@InactivePurge Tinyint,
@CreditStatus Tinyint,
@CreditLimit Int

------- Get the new Customer data from Inserted table

SELECT @CustomerN = CAST(RTRIM(i.CUSTNMBR) as Integer),
@SICCode = ISNULL((SELECT Dex_Row_ID FROM RM00201 WHERE RM00201.CLASSID = i.CUSTCLAS),0),
@ARContact = RTRIM(i.CNTCPRSN),
@LongName = RTRIM(i.STMTNAME),
@CustomerName = RTRIM(i.SHRTNAME),
@SalesTaxCode = ISNULL((SELECT Dex_Row_ID FROM TX00101 WHERE TX00101.TAXSCHID = i.TAXSCHID),0),
@AddrLine1 = RTRIM(i.ADDRESS1),
@AddrLine2 = RTRIM(i.ADDRESS2),
@AddrLine3 = RTRIM(i.ADDRESS3),
@City = RTRIM(i.CITY),
@StateProv = RTRIM(LEFT(i.STATE,2)),
@PostalCode = RTRIM(i.ZIP),
@TelephoneN = RTRIM(LEFT(i.PHONE1,10)),
@FaxTelephoneN = RTRIM(LEFT(i.FAX,10)),
@SalespersonN = RTRIM(i.SLPRSNID),
@TermsCode = RTRIM(i.PYMTRMID),
@CustRateSched = RTRIM(i.DEX_ROW_ID),
@SalesAreaCode = ISNULL((SELECT Dex_Row_ID FROM RM00303 WHERE RM00303.SALSTERR = i.SALSTERR),0),
@InactivePurge = i.INACTIVE,
@CreditStatus = i.HOLD,
@CreditLimit = i.CRLMTAMT
FROM inserted i

------- Get Logic server name and database name

SELECT @Server_Name = RTRIM(l.Server_Name),
@Logic_DB_Name = RTRIM(l.Logic_DB_Name)
FROM tbl_Logic_DB l

------- Insert new Customer record into Logic database

SET @SQLStr = 'UPDATE [' + @Server_Name + '].[' + @Logic_DB_Name + '].dbo.[Customer] ' + '
SET SICCode = ' + CAST(@SICCode as varchar(10)) + ', ' + '
ARContact = ''' + @ARContact + ''', ' + '
LongName = ''' + @LongName + ''', ' + '
CustomerName = ''' + @CustomerName + ''', ' + '
SalesTaxCode = ' + CAST(@SalesTaxCode as varchar(10)) + ', ' + '
AddrLine1 = ''' + @AddrLine1 + ''', ' + '
AddrLine2 = ''' + @AddrLine2 + ''', ' + '
AddrLine3 = ''' + @AddrLine3 + ''', ' + '
City = ''' + @City + ''', ' + '
StateProv = ''' + @StateProv + ''', ' + '
PostalCode = ''' + @PostalCode + ''', ' + '
FaxTelephoneN = ''' + @TelephoneN + ''',' + '
SalespersonN = ' + CAST(@SalespersonN as varchar(10)) + ', ' + '
CommentN1 = ''' + @TermsCode + ''', ' + '
CustRateSched = ' + CAST(@CustRateSched as varchar(10)) + ', ' + '
SalesAreaCode = ' + CAST(@SalesAreaCode as varchar(10)) + ', ' + '
InactivePurge = ' + CAST(@InactivePurge as varchar(10)) + ', ' + '
CreditStatus = ' + CAST(@CreditStatus as varchar(10)) + ', ' + '
CreditLimit = ' + CAST(@CreditLimit as varchar(10)) + ' ' + '
WHERE CustomerN = ' + CAST(@CustomerN as varchar(10))


SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
SET XACT_ABORT ON

EXEC sp_executesql @SQLStr

END

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

View 1 Replies View Related







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