We are using a simple CLR sp where an SQL statement is executed inside the same. THe execution happens in a server of different context that is connected inside CLR sp. The result set is returned in tabular format using pipe. But, when we access the result as below
it give the following error. Any help is appreciated. It seems to be some error with distibuted transaction. We tried adding BEgin Distributed trnasaction, but still the error comes.
Msg 6522, Level 16, State 1, Procedure TestProc, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "TestProc":
System.Transactions.TransactionException: The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025) ---> System.Runtime.InteropServices.COMException: The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)
System.Runtime.InteropServices.COMException:
at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
System.Transactions.TransactionException:
at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
Hi, I'm at my wit's end with this. I have a simple stored procedure: PROCEDURE [dbo].[PayWeb_getUserProfile] ( @user_id_str varchar(36), @f_name varchar(50) OUTPUT)AS BEGINDECLARE @user_id uniqueidentifier; SELECT @user_id = CONVERT(uniqueidentifier, @user_id_str); select @f_name=f_name FROM dbo.tbl_user_profile WHERE user_id = @user_id; ENDRETURN The proc runs perfectly from the Management Console. In my ASP.net form (C#), the following always results in: "Invalid attempt to read when no data is present." (I'll highlight the line where the error results): SqlConnection conn = new SqlConnection(<connection string data>);SqlDataReader reader; SqlCommand comm = new SqlCommand("dbo.PayWeb_getUserProfile", conn);comm.CommandType = System.Data.CommandType.StoredProcedure; SqlParameter f_name = new SqlParameter("@f_name", SqlDbType.VarChar, 50); f_name.Direction = ParameterDirection.Output;comm.Parameters.Add(f_name); comm.Parameters.Add("@user_id_str", SqlDbType.VarChar, 36).Value = Membership.GetUser().ProviderUserKey.ToString().ToUpper();reader = comm.ExecuteReader();Response.Write("Num: " + reader["@f_name"].ToString()); // ERROR: Invalid attempt to read when no data is present. reader.Close();conn.Close(); The data is there. When I put a watch on 'Reader', I see the correct first_name data there. Your help is appreciated.
Hello, I have a web application which retrieves values from a table and the table has grown really huge now. This has slowed down the performance and I need to do something else instead of the select statement that I currently have. Can cursors be a solution? Any help/suggestions would be greatly appreciated.
I need to send the result of a procedure to an update statement.Basically updating the column of one table with the result of aquery in a stored procedure. It only returns one value, if it didnt Icould see why it would not work, but it only returns a count.Lets say I have a sproc like so:create proc sp_countclients@datecreated datetimeasset nocount onselect count(clientid) as countfrom clientstablewhere datecreated > @datecreatedThen, I want to update another table with that value:Declare @dc datetimeset @dc = '2003-09-30'update anothertableset ClientCount = (exec sp_countclients @dc) -- this line errorswhere id_ = @@identityOR, I could try this, but still gives me error:declare @c intset @c = exec sp_countclients @dcWhat should I do?Thanks in advance!Greg
HI, I ran a select * from customers where state ='va', this is the result...
(29 row(s) affected) The following file has been saved successfully: C:outputcustomers.rpt 10826 bytes
I choose Query select to a file then when I tried to open the customer.rpt from the c drive I got this error message. I am not sure why this happend invalid TLV record
I am accessing data (YTD Hours for a selected employee) through the view "dbo_TIMS_HSTU_HoursHist_Insync" which is connected by ODBC to my application. The result "HSTUHoursPriorPeriods" is used to determine the rate of pay for a specific employee and is run literall each time a user enters a pay record at data entry.
Because the view itself returns about 1,000 records, before I select the specific record and associated Hours, it is a little slow from a data entry standpoint.
I understand I can achieve the same result through an SQL Procedure, but for the life of me I don't know how.
For a particular application i retrieve records using stored procedure and bind the same to the data grid and display the same. The data are fetched from a table say A joined with couple of tables to staisfy the requirement. Now this table A has around 3700000 + records. The Select statement is as
Select column1, column 2, column 3...................... column 25 from table A
inner join hash table D on A.Column3 = D.Column3 and A.Column4 = D.Column4 and a.nColumn1 = @ParameterVariable Inner join table B on a.nColumn1 =b.nColumn1 inner join table C on A.column2 = C.column2
Indices defined on A are IDX1 : Column 3, Column 4 IDX2 : Column 1
Around 350 records per second are inserted into the table A during the peak operation time. During this time when executing the procedure, it takes around 4 mins to fetch just 25000 records.
I need to fine tune the procedure. Please suggest me on same.
Hi. I have a stored procedure "sp1" which returns a value (with the sql statement Return @ReturnValue). Is it possible for my asp.net page to retrieve this return value, and to do it declaratively (meaning without writing code to connect to the database in the code behind). If it is possible to do it like this please tell me how, and if not please tell me how to do it with code. Thanks in advance .
Hi i have the following stored procedure which should retrieve data, the problem is that when the user enters a name into the textbox and chooses an option from the dropdownlist it brings back duplicate data and data which should be appearing because the user has entered the exact name they are looking for into the textbox. For instance Pmillio Jones Pmillio Jones Pmillio Jones Robert Walsh Here is my stored procedure; ALTER PROCEDURE [dbo].[stream_UserFind] -- Add the parameters for the stored procedure here @userName varchar(100), @subCategoryID INT,@regionID INT AS SELECT DISTINCT SubCategories.subCategoryID, SubCategories.subCategoryName, Users.userName ,UserSubCategories.userIDFROM Users INNER JOIN UserSubCategoriesON Users.userID= UserSubCategories.userIDINNER JOIN SubCategories ON UserSubCategories.subCategoryID = SubCategories.subCategoryID WHEREuserName LIKE COALESCE(@userName, userName) OR SubCategories.subCategoryID = COALESCE(@subCategoryID,SubCategories.subCategoryID);
Is there a way to retrieve the parameter list for a given stored procedure?
I am trying to create a program that will autogenerate a list of stored procedures and their parameters so that changes to the database can be accurately reflected in code.
We have a domain where all computers are on GMT(Greenwitch Mean Time). We have an access front end that timestamps certain fields according to the client time that the program is running on, but we will be moving our client workstations off of GMT time and keep our SQL Server on GMT time, and want to keep the timestamps GMT.
So, I wanted to know if it was possible to create a stored procedure that gets the Server's time and returns it to the Access frontend for entry into the timestamp fields?
Or, if anyone has a better idea of how to get the time from the server to use on the clients, I would greatly appreciate it!!!
Please excuse me if this question has been asked before; I couldn’t find it. Perhaps someone could point me to the solution. A few years ago I wrote an order-entry application in classic ASP that I am now re-writing in ASP.NET 2.0. I am having very good success however I can’t figure out how to retrieve data from a stored procedure. I am using the FormView & SqlDataSource controls with a stored procedure to insert items into an order. Every time an item is inserted into the order the stored procedure does all kinds of business logic to figure out if the order qualifies for pricing promotions, free shipping, etc. If something happens that the user needs to know about the stored procedure returns a message with this line (last line in the SP) SELECT @MessageCode AS MessageCode, @MessageText AS MessageText I need to retrieve both the @MessageCode and the @MessageText values in my application. In classic ASP I retrieved these values by executing the SP with a MyRecordset.Open() and accessing them as normal fields in the recordset. In ASP.NET I have specified the SP as the InsertCommand for the SqlDataSource control. I have supplied all the parameters required by my SP and told the SqlDataSource that the insert command is a “StoredProcedure�. Everything actuly works just fine. The items are added to the order and the business logic in the SP works fine. I just have no way of telling the user that something important has happened. Does anyone know how I can pickup these values so that I can show them to my users? Bassicly if @MessageCode <> 0 I want to show @MessageText on the screen.
I'm generating a list of parameters needed by stored procedures, and I'd like to know which ones have default values assigned to them. To retrieve the parameter information I use:
sp_sproc_columns @Procedure_Name='InsertUser''
However, the column that is supposed to give the default value, 'COLUMN_DEF' always returns as NULL, even when that column has a default value assigned to it. i.e. CREATE PROCEDURE InsertUser@UserID INT = 10,.....
And then if I do a sp_sproc_columns @Procedure_Name='InsertUser'', the COLUMN_DEF value for the @UserID column is still NULL.
Does anyone know what I'm doing wrong and how I can retrieve the default value?
Hello!I use a procedure to insert a new row into a table with an identitycolumn. The procedure has an output parameter which gives me theinserted identity value. This worked well for a long time. Now theidentity value is over 700.000 and I get errors whiles retrieving theinserted identitiy value. If I delete rows and reset the identityeverything works well again. So I think it is a data type problem.My Procedure:create procedure InsertProduct@NEWID int outputasbeginset nocount oninsert into PRODUCT(D_CREATED)values(getdate()+'')set nocount offselect @NEWID = @@IDENTITYendMy C# code:SqlCommand comm = new SqlCommand("InsertProduct", sqlCon);comm.CommandType = CommandType.StoredProcedure;comm.Parameters.Add(new SqlParameter("@NEWID",System.Data.SqlDbType.Int)).Direction =System.Data.ParameterDirection.Output;try{SqlDataReader sqlRead = comm.ExecuteReader();object o = comm.Parameters["@NEWID"].Value;//...}catch ( Exception ex ){throw ex;}The object o is alwaya System.DbNull. I also tried to use bigint.Any hints are welcomeCiaoSusanne
I have a report serve at http://MyServer/reportserver My Asp .net web application is running on anothere machine http://WebappMachine/default.aspx.
Here is what is happening 1.My Report server admin created a folder <<MyName>> and gave me user name and password to acess it .
2.I connect through url http://Servername/reportserver . server prompts me for Username and password . When I key in user name pass word it takes me to the root . I browsed through to the <<MyNameReports>> and created datasource and uploaded .RDL files.
3.I browse the URL to run reports externally using http://myReportserver/ReportServer/Pages/ReportViewer.aspx?%2fDeveloper%2fmyname%2fReports%2ftestreport&rs:Command=Render
it works .
4. I am developing a web app in Asp .net and use reportviewer control to show the report. Credentials is the same as what I using during manually running the reports .Code is as follows
Me.ReportViewer1.ServerReport.ReportServerCredentials = New System.Net.NetworkCredential(uid, pwd) Me.ReportViewer1.ProcessingMode = ProcessingMode.Remote Me.ReportViewer1.ServerReport.ReportServerUrl = New System.Uri("http://myreportserver/reportserver") Me.ReportViewer1.ServerReport.ReportPath = New String("/Developer/myname/Reports/testReport") Me.ReportViewer1.ServerReport.SetParameters(RptParameters) Me.ReportViewer1.ServerReport.Refresh()
I get following error .
"The request failed with the error message: -- <html><head><title>Object moved</title></head><body>
Object moved to here.
</body></html>
--."
I tried to use API
Dim rs As New Microsoft.SqlServer.ReportingServices2005.ReportingService2005() rs.Url = "http://myreportserver/reportserver/ReportService2005.asmx" rs.Credentials = New System.Net.NetworkCredential(UID, PWD) rs.LogonUser(UID, PWD, Nothing)
Dim items As CatalogItem() = rs.ListChildren("/Developer/myname/Reports", True)
When I debug , it pass through LogonUser method ( or Displays Logon failed when wrng pwd entered ) .But displays same message as above when ListChildren is called .
I appreciate for your time and would be of great help if someone can help me with this .
Please HELP! On my asp.NET page I'm setting a datetime variable to Now() and inserting that value into SQL Server as a datetime stamp. I want to then retrieve the count of the number of records that were inserted into the table that have that value. The field in the table is just a datetime datatype.But it's returning 0 records because the Now() value is getting converted to military time and losing the seconds! For example, Now() is "9/13/2005 2:48:25 PM" but the value being inserted into the table is "2005-09-13 14:48:00.000".ARRRGGHH! What am I missing?? What do I need to do to be able to (1) keep the seconds, and (2) identify the records in order to retrieve them?Thanks in advance for your help!!!Lynnette
I'm new to SQL Server and I'm building an SQL Server 2000 database that will be loaded and accessed via stored procedures.
One of the requirements is that I have to log any errors that occur to an error log table containing the date/time, error code and the exact error text - ie containing problem table name, column name, etc.
The problem I'm having is that I can't see a way of capturing the exact error text in a stored procedure. The only thing that seems available is @@error which only returns the error code - not the actual text. I could go to the sysmessages table using the error code but that'll only return the message template containing parameters - not containing the actual table/column/etc causing the problem.
Does anyone have any ideas how to retrieve the exact error message text?
well i have got a form which displays some result from the databasse, it runs fi9 in webmatrix, but when i try to run it from my main page and when i click on that button which should displays the aspx page, it gives me this error:
Server Error in '/' Application. --------------------------------------------------------------------------------
Login failed for user 'MUFADDALASPNET'. 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.Data.SqlClient.SqlException: Login failed for user 'MUFADDALASPNET'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
I have created stored procedures and I am checking whether any error has occured on execution of the statements in that procedure.
If the @@Error <>0 then I need to log this error into my error logging table. For this, I need to retrieve the error description given by SQL SERVER 2000.
I tried this using the master.dbo.sysmessages table. But I get a text from master.dbo.sysmessages which has the placeholders like %l, %s, etc.
I dont want this type of error. I want the exact error description which has the actual objects names and not the placeholders.
I found some help at this link : http://www.sommarskog.se/error-handling-I.html#textretrieve
But i want to know whether there is any other way of doing this or not.
I have some VB.NET code to retrieve data from an SQL Server database and display it. The code is as follows: ------------------------------------------------------------------------------------------------------- sw_calendar = calendarAdapter.GetEventByID(cid) If sw_calendar.Rows.Count > 0 Then
lblStartDateText.Text = "*** Not Found ***" lblEndDateText.Text = "*** Not Found ***" lblTitleText.Text = "*** Not Found ***" lblLocationText.Text = "*** Not Found ***" lblDescriptionText.Text = "*** Not Found ***" End If ------------------------------------------------------------------------------------------------------- If all of the fields in the database has values, everything works ok. However, if the title, location or description fields have a null value, I receive the following error message: Unable to cast object of type 'System.DBNull' to type 'System.String'. I've tried a bunch of different things such as:
Adding ".ToString" to the database field, Seeing if the value is null: If sw_calendar(0).description = system.DBnull.value... ...but either I get syntax errors in the code, or if the syntax is ok, I still get the above error message. Can anyone help me with the code required to trap the null within the code example I've provided? I'm sure there are other, and better, ways to code this, but for now I'd really like to get it working as is, and then optimize the code once the application is working (...can you tell I have a tight deadline )
I am having trouble returning the correct record with my stored procedure. my problem is that i don't know how to structure the sql statement to do the following: given a set of records that have the same loankey, i need to 1. find the record that has most recent date (lockExprDt) 2. for all records with that date, find the highest Lock Number (LockNo) 3. for the all the records with that date and that LockNo, find the highest extension number (Ext) currently my sql statement returns a record that has the most recent date. i don't now how to write the sql to further define my query to return the record that has the most recent date with highest lock number, and finally the highest extension number. any suggestions as to what i am doing wrong. below is my slq statement. please note that i need to add the sql that will query for the max LockNo, and max Ext. Any help is greatly appreciated. thx! select a.loankey, a.lockrate, a.investor, a.price, a.ext, a.cost, a.lockno, a.lockstatus , CASE WHEN CONVERT(CHAR(8),a.lockdate,10)='12:00:00 AM' THEN NULL ELSE CONVERT(CHAR(8),a.lockdate,10) END as 'LockDate' , CASE WHEN CONVERT(CHAR(8),b.lockExprDt,10)='12:00:00 AM' THEN NULL ELSE CONVERT(CHAR(8),b.lockExprDt,10) END as 'LockExprDt' , Case WHEN CONVERT(CHAR(8),b.lockExprDt,10)>= CONVERT(CHAR(8),GETDATE(),10) THEN datediff(day, CONVERT(CHAR(8),GETDATE(),10), CONVERT(CHAR(8),b.lockExprDt,10)) ELSE NULL END as 'Days' from cfcdb..locktable ainner join (select loankey, max(lockExprDt) as lockExprDtfrom cfcdb..locktablegroup by loankey) bON a.loankey = b.loankey AND a.lockExprDt = b.lockExprDt where a.loankey = @LoanKey
Some T-SQL commands can fail with multiple errors. For example, if you try to disable a primary key constraint using ALTER TABLE t1 NOCHECK CONSTRAINT PK, you will get messages like:
Msg 11415, Level 16, State 1, Line 341 Object 'PK' cannot be disabled or enabled. This action applies only to foreign key and check constraints. Msg 4916, Level 16, State 0, Line 341 Could not enable or disable the constraint. See previous errors.
However, in the code below, only the last message is printed. How can I print all the error messages?
USE tempdb; CREATE TABLE #t1(c1 INT CONSTRAINT PK PRIMARY KEY); BEGIN TRY ALTER TABLE #t1 NOCHECK CONSTRAINT PK; PRINT 'Primary key disabled' END TRY BEGIN CATCH PRINT ERROR_MESSAGE(); END CATCH
I am running SQL Service Migration Assistant for Access 6.0 and I am getting the following error when I attempt 'Refresh from database':
Access Object Collector error: Database
Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
This error may be a result of running SSMA as 64-bit application while having only 32-bit connectivity components installed or vice versa. You can run 32-bit SSMA application if you have 32-bit connectivity components or 64-bit SSMA application if you have 64-bit connectivity components, shortcut to both 32-bit and 64-bit SSMA can be found under the Programs menu.
You can also consider updating your connectivity components from [URL] ....
An error occurred while loading database content.
I've clicked on the link above and installed the Access 2010 Runtime that I found there, but that is not working the problem. I'm running Access 2013 (32-bit) on a Windows 8.1 (64-bit).
Hello evry1. i m new to SQL Server2000. plzz tell me where i m wrong in this SP . this procedure is not giving any error but it is not showing any result. plzz help me n give me any idea if u know how i can solve my problem best regards sadaf n here is the procedure
begin select * from [profile] where [user_name] like '%@user_name1%' and place like '%@place%' and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@gender1 is not null and len(@gender1) > 0) begin select * from [profile] where gender = @gender1 and place like '%@place%' and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if(@email_address1 is not null and len(@email_address1) > 0) begin select * from [profile] where [email-address] like '%@email_address1%' and place like '%@place%' and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if(@relegion1 is not null and len(@relegion1) > 0) begin select * from [profile] where relegion = @relegion1 and place like '%@place%' and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@political_view1 is not null and len(@political_view1) > 0) begin select * from [profile] where political_view = @political_view1 and place like '%@place%' and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@passion1 is not null and len(@passion1) > 0) begin select * from [profile] where passion like '%@passion1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if(@sports1 is not null and len(@sports1) > 0) begin select * from [profile] where sports like '%@sports1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@activities1 is not null and len(@activities1) > 0) begin select * from [profile] where activities like '%@activities%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@books1 is not null and len(@books1) > 0) begin select * from [profile] where books like '%books1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@music1 is not null and len(@music1) > 0) begin select * from [profile] where music like '%@music%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if(@tv_shows1 is not null and len(@tv_shows1) > 0) begin select * from [profile] where tv_shows like '%@tv_shows1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@movies1 is not null and len(@movies1) > 0) begin select * from [profile] where movies like '%@movies1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@cuisines1 is not null and len(@cuisines1) > 0) begin select * from [profile] where cuisines like '%@cuisines1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@intrested_in1 is not null and len(@intrested_in1) > 0) begin select * from [profile] where intrested_in = @intrested_in1 and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@education1 is not null and len(@education1) > 0) begin select * from [profile] where education like'%@education1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@college_university1 is not null and len(@college_university1) > 0) begin select * from [profile] where institution like '%@college_university1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@occupation1 is not null and len(@occupation1) > 0) begin select * from [profile] where occupation like '%@occupation1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@industry1 is not null and len(@industry1) > 0) begin select * from [profile] where industry like '%@industry1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@job_desc1 is not null and len(@job_desc1) > 0) begin select * from [profile] where job_desc like '%@job_desc1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end if (@career_intrest1 is not null and len(@career_intrest1) > 0) begin select * from [profile] where career_intrest like '%@career_intrest1%' and place = @place1 and latitude=@latitude1 and longitude=@longitude1 and signup_name != @signup; end GO
i made a new stored procedure and execute it. it works great but where can i see the result ? i want to see the number of Count(*) in a window inside the SQL Server Managment studio, can i ?
I hvae a stored procedure that has this at the end of it: BEGIN EXEC @ActionID = ActionInsert '', @PackageID, @AnotherID, 0, '' END SET NOCOUNT OFF
SELECT Something FROM Something Joins….. Where Something = Something now, ActionInsert returns a Value, and has a SELECT @ActionID at the end of the stored procedure. What's happening, if that 2nd line that I pasted gets called, 2 result sets are being returned. How can I modify this SToredProcedure to stop returning the result set from ActionINsert?
I am working on a project to write SSIS packages to update a SQL Server 2005 database with data from an Oracle 10g database. Unfortunately, our development ETL box is running 32 bit Windows Server 2003 while the production ETL box is running 64 bit Itanium Windows Server 2003. We have created SQL Server Agent jobs to execute all of our packages. All of our jobs run without error on the 32 bit development box, but in our preproduction tests they are failing in the 64 bit box.
In my testing, I've found that I can successfully pull character data from Oracle. For example, I can write a package that retrieves the data for the following query:
SELECT 'test' FROM dual
However, the following fails:
SELECT 1 FROM dual
I have logging turned on in my package. When the package fails, I typically see informational messages in the log up to the point of failure, but no actual error event logs are generated. The only error information I have is in the SQL Server Agent job history log, which contains the following:
Executed as user: SERVERNAMESYSTEM. The return value was unknown. The process exit code was -2147483646. The step failed.
I have also tried using the 64 bit version of the DTS Wizard to create a sample package, and observe the same behavior. When I run the DTS Wizard, queries that return numeric data cause DTSWizard.exe to exit and produce the following message in the application event log:
Event Type: Error Event Source: .NET Runtime 2.0 Error Reporting Event Category: None Event ID: 1000 Date: 2/1/2007 Time: 12:36:13 PM User: N/A Computer: SERVERNAME Description: Faulting application dtswizard.exe, version 9.0.2047.0, stamp 443f5e50, faulting module oracore10.dll, version 10.2.0.1, stamp 435841b0, debug? 0, fault address 0x00000000001e4910.Has anyone else experienced similar behavior, and know of a solution aside of wrapping all retrieval of numeric data in to_chars in our Oracle queries?
I have a store procedure that works fine when tested in SQL Management Studio and Visual Studio but when I actually running the page in a browser, it does not work. There is no result generated. Below is my store procedure.1 ALTER PROCEDURE [dbo].[spSearch] 2 -- Add the parameters for the stored procedure here 3 @schoolID int = NULL, 4 @scholarship varchar(250) = NULL, 5 @major varchar(250) = NULL, 6 @requirement varchar(250) = NULL 7 --@debug bit = 0 8 AS 9 BEGIN 10 -- SET NOCOUNT ON added to prevent extra result sets from 11 -- interfering with SELECT statements. 12 SET NOCOUNT ON; 13 14 -- Insert statements for procedure here 15 16 Declare @SQL as NVarchar(4000); 17 Declare @Params as NVarchar(3000); 18 Set @SQL = N'SELECT * FROM [scholarship] WHERE [sectionID] = @schoolID'; 19 Set @Params = N'@schoolID int,@scholarship varchar(250),@major varchar(250),@requirement varchar(250)' 20 21 If @scholarship IS NOT NULL 22 Set @SQL = @SQL + N' AND [scholarship].[schlrName] LIKE + ''%'' + @scholarship + ''%''' 23 If @major IS NOT NULL 24 Set @SQL = @SQL + N' AND [scholarship].[Specification] LIKE + ''%'' + @major + ''%''' 25 If @requirement IS NOT NULL 26 Set @SQL = @SQL + N' AND ([scholarship].[reqr1] LIKE + ''%'' + @requirement + ''%''' 27 If @requirement IS NOT NULL 28 Set @SQL = @SQL + N' OR [scholarship].[reqr2] LIKE + ''%'' + @requirement + ''%''' 29 If @requirement IS NOT NULL 30 Set @SQL = @SQL + N' OR [scholarship].[reqr3] LIKE + ''%'' + @requirement + ''%''' 31 If @requirement IS NOT NULL 32 Set @SQL = @SQL + N' OR [scholarship].[reqr4] LIKE + ''%'' + @requirement + ''%''' 33 If @requirement IS NOT NULL 34 Set @SQL = @SQL + N' OR [scholarship].[reqr5] LIKE + ''%'' + @requirement + ''%'')' 35 --If @debug = 1 36 --PRINT @SQL 37 Exec sp_executesql @SQL, @Params, @schoolID, @scholarship, @major, @requirement 38 END 39