Trouble Converting A Varbinary (Object) To A String Through Script Task
Dec 9, 2006
I have an Execute SQL Task that queries for the contents of a file (which is declared as a varbinary type). My SSIS package needs to write these contents into a temporary location, so what I do is that I pass the result into a System.Object variable. I then use that variable in a Script Task.
Problem is whenever I execute my script task and DirectCast or CType the variable to a string (which is what the contents of the file is), I get a "Conversion from type '_ComObject' to type 'String' is not valid."
Any ideas on how to go about this problem?
View 1 Replies
ADVERTISEMENT
Mar 31, 2008
Hi Gurus,
Here is my problem-:
I have a field in the SQL 2005 database with type varbinary(50). Now when i enter value to this field, I enter a value for example 111111101. The reason to enter such a value in varbinary(50) type is, that this value is meant to grow, as each 1 and 0 in this value is a permission or right my user would have to various features of the web application, I am designing. Now when I open the table to see the data in the database, it shows as <Binary data>. But that's okay, as binary fields are mostly meant to store pictures, files etc. But when I read this value into my ASP.Net code using c#, the value as returned as 069F6BBD. After some research I realized that for decimal value 111111101, the hex value is 069F6BBD.
All I need in my code is the same thing that I entered which is 111111101.
Can someone guide me a lil bit.
Thanks in advance..
VJ
View 7 Replies
View Related
May 5, 2006
I'm using SQL Server 2005. How can I convert a hex string to a varbinary or the opposite of that?
View 6 Replies
View Related
Apr 20, 2008
I have been working on this all day and cannot find an answer
I need to convert a string to an object, a string to object of type Command
Is there anyway to do this?
Thank you all in advance!!!!!!!
View 1 Replies
View Related
Jul 13, 2006
The source is a flat file with a column where dates are stored as: 07/12/2006 11:35am. In some cases the column is blank.
I need to import this into a table with a datetime column. In the data flow task, I get the error that conversion b/w String and DB_Timestamp is not allowed. First question is why does SSIS think its a DB_Timestamp column? Shouldnt it be DB_Date or DB_Time. Anyway, when I add a Data Conversion Task in the Data Flow, and cast to the source column to either DB_TimeStamp, DB_Date or DB_Time I get an error.
Please help. What am I doing wrong.
Asim.
View 7 Replies
View Related
Jun 23, 2005
I have a password field which is of varbinary. Since its a varbinary I
cannot see the password in the database I only see hexadecimal values.
Now my question is that how can I convert those hexadecimal values to
string or varchar so I can read the password.
any ideas ??
View 1 Replies
View Related
Feb 17, 2014
I have a very large database running in a production environment. The backup files are getting to be very difficult to manage. They are at 70gb as of now and growing at a rate of 10gb per month. This is due to document images being stored in the database in one table. I have read a little about a new feature in SQL Server 2012 called Filetable. Can we migrate to SQL Server 2012 and convert to the filetable structure, will this decrease the size of the backups? Would backup of the document images be taken care of by our nightly file system backups now?
View 1 Replies
View Related
May 27, 2008
Hi All,
i have a table in MS Access with CandidateId and Image column. Image column is in OLE object format. i need to move this to SQL server 2005 with CandidateId column with integer and candidate Image column to Image datatype.
its very udgent, i need any tool to move this to SQL server 2005 or i need a code to move this table from MS Access to SQL server 2005 in C#.
please do the needfull ASAP. waiting for your reply
with regards
View 1 Replies
View Related
Aug 27, 2015
I am using rowVersion to detect rows that need to be re-extracted for my ETL. Â The first step in the ETL is to get MIN_ACTIVE_ROWVERSION() from the database, as well as the rowVersion from the last successful ETL run. Â Both of these values are saved in variables in SSIS. Â Since SSIS doesn't have an associated data type, these values are converted to nvarchar(512) before getting sent to SSIS. Â
I'm now trying to create a stored procedure to grab the data out of the source system. Â The sproc takes RowVersionMin and RowVersionMax as input parameters. Â Those parameters are then converted to varbinary(max), and I use them in a query to select the appropriate rows.
When I run the sproc in SSMS, it runs without a problem. Â However, when I try to use the sproc as a data source in SSIS, I get the following error: "Error converting data type nvarchar to varbinary". Why SSIS has a problem with this, but SSMS does not? Â The sproc code looks like this:
ALTER PROCEDURE [dbo].[dw_DimComment_DataLoad]
@RunType varchar(3),
@RowVersionMin nvarchar(512),
@RowVersionMax nvarchar(512)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
[Code] ....
View 2 Replies
View Related
Aug 23, 2006
I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.
Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.
Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.
Is this an intrinsic issue?
View 2 Replies
View Related
Sep 13, 2006
I am trying to execute this code feom Script task while excuting its giving me error that "Object reference not set to an instance of an object." The assemblies Iam referening in this code are there in GAC. Any idea abt this.
Thanks,
Public Sub Main()
Dim remoteUri As String
Dim fireAgain As Boolean
Dim uriVarName As String
Dim fileVarName As String
Dim httpConnection As Microsoft.SqlServer.Dts.Runtime.HttpClientConnection
Dim emptyBytes(0) As Byte
Dim SessionID As String
Dim CusAuth As CustomAuth
Try
' Determine the correct variables to read for URI and filename
uriVarName = "vsReportUri"
fileVarName = "vsReportDownloadFilename"
' create SessionID for use with HD Custom authentication
CusAuth = New CustomAuth(ASCIIEncoding.ASCII.GetBytes(Dts.Variables("in_vsBatchKey").Value.ToString()))
Dts.Variables(uriVarName).Value = Dts.Variables(uriVarName).Value.ToString() + "&" + _
"BeginDate=" + Dts.Variables("in_vsBeginDate").Value.ToString() + "&" + _
"EndDate=" + Dts.Variables("in_vsEndDate").Value.ToString()
Dim request As HttpWebRequest = CType(WebRequest.Create(Dts.Variables(uriVarName).Value.ToString()), HttpWebRequest)
'Set credentials based on the credentials found in the variables
request.Credentials = New NetworkCredential(Dts.Variables("in_vsReportUsername").Value.ToString(), _
Dts.Variables("in_vsReportPassword").Value.ToString(), _
Dts.Variables("in_vsReportDomain").Value.ToString())
'Place the custom authentication session ID in a cookie called BatchSession
request.CookieContainer.Add(New Cookie("BatchSession", CusAuth.GenerateSession("EmailAlertingSSIS"), "/", Dts.Variables("in_vsReportDomain").Value.ToString()))
' Set some reasonable limits on resources used by this request
request.MaximumAutomaticRedirections = 4
request.MaximumResponseHeadersLength = 4
' Prepare to download, write messages indicating download start
Dts.Events.FireInformation(0, String.Empty, String.Format("Downloading '{0}' from '{1}'", _
Dts.Variables(fileVarName).Value.ToString(), Dts.Variables(uriVarName).Value.ToString()), String.Empty, 0, fireAgain)
Dts.Log(String.Format("Downloading '{0}' from '{1}'", Dts.Variables(fileVarName).Value.ToString(), Dts.Variables(uriVarName).Value.ToString()), 0, emptyBytes)
' Download data
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
' Get the stream associated with the response.
Dim receiveStream As Stream = response.GetResponseStream()
' Pipes the stream to a higher level stream reader with the required encoding format.
Dim readStream As New StreamReader(receiveStream, Encoding.UTF8)
Dim fileStream As New StreamWriter(Dts.Variables(fileVarName).Value.ToString())
fileStream.Write(readStream.ReadToEnd())
fileStream.Flush()
fileStream.Close()
readStream.Close()
fileStream.Dispose()
readStream.Dispose()
'Download the file and report success
Dts.TaskResult = Dts.Results.Success
Catch ex As Exception
' post the error message we got back.
Dts.Events.FireError(0, String.Empty, ex.Message, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
View 1 Replies
View Related
Jun 6, 2007
When I try and parse a simple execute of a stored procedure in the Execute SQL Task Editor, I get the error:
"Object reference not set to an instance of an object"
Now, I ONLY get this error on my laptop, so I'm assuming it might be an installation error. I've tried to do the exact same thing in other environments, and received no error. Here's what I'm doing:
1. I create a simple stored procedure on a SQL 2005 database. Here's what it does:
create proc usp_testsp
as
begin
select 'whatever' ;
end
2. I create a new SSIS package in BIS.
3. I create an ADO.NET connection to the above SQL 2005 database
4. I pull over an Execute SQL Task item from the toolbox to the Control Flow tab.
5. I choose the ADO.NET connectiontype, the connection I created in #2, SQLSourceType of Direct input, SQLStatement is: exec usp_testsp, IsQueryStoredProcedure set to True. And I try ResultSet as both Single row and None
When I try to Parse the Query, I get the above error. If I still try to run the task in the debugger, here's what I get with the ResultSet set to None:
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "exec usp_testsp" failed with the following error: "Could not find stored procedure 'exec usp_testsp'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
And just so you know, I can execute the sp with no problems. And just to check, I granted execute to public on the sp.
And here's what I get with ResultSet set to Single row:
Error: 0xC00291E2 at Execute SQL Task, Execute SQL Task: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_SingleRow".
I only get this on my laptop. I have SQL Server 2005 SP2 Developer Edition on Windows XP Professional, SP2.
Thanks,
Michael
View 3 Replies
View Related
May 19, 2008
i have some code in a script task component which is meant to find a cell in an excel sheet and assign a variable to its value in the script component. I receive an error that the object is not set in instance of object. below is the code which i tried to simplify to find the error, but it is still occurring. any help would be appreciated. thank you
Dim vars As IDTSVariables90
vars.Unlock()
Me.VariableDispenser.LockForWrite(Variables.freq)
Variables.freq = "1"
View 1 Replies
View Related
Jun 27, 2007
Hi all,
Does anyone see the error below before?
I am using SSIS Execute SQL Task (ADO.NET) to update a table using a stored procedure.
It works like this many times for me and all of a sudden, not sure what is changing in the environment, I kept getting this WARNING when I click on PARSE QUERY
€œObject Reference Not Set to An Instance of an Object€? when I click on PARSE QUERY.
This is going against SQL SERVER 2005 SP2 x64 Enterprise.
Note that this task executes fine and the stored procedure updates data.
The stored procedure does the following.
There are other stored procedures of different kinds and they all worked.
But all of them give this error when I click on PARSE QUERY.
Code Snippet
DECLARE @TodayDate datetime
SET @TodayDate = GETDATE()
Exec dbo.updDimBatch
@BatchKey = @BatchKey,
@ParentBatchKey = @ParentBatchKey,
@BatchName = 'Load Customer Increment',
@BatchStartDate = NULL,
@BatchEndDate = @TodayDate,
@StatusKey = NULL,
@RowsInserted = @Count_Insert,
@RowsUpdated = @Count_Update,
@RowsException = NULL,
@RowsError = NULL,
@UpdatedDate = @TodayDate,
@BatchDescription = NULL
OLEDB Sample also give me syntax error
exec dbo.updDimBatch ?,?,'Load Activity Increment','6/27/2007','6/27/2007',1,?,?,0,0,'6/27/2007',''
I tried to change to OLEDB and call the stored procedure like this but got syntax error?
Not sure what is the error here.
View 2 Replies
View Related
Feb 18, 2007
Hi, I am deploying my web through a web hosting services which provides SQL database support. I got following errors whenever I try to open my webpage,which never happen when I run my web on the local machine. I have my connection string configured in my web.config as below:
<add name="ArtHouseConnection" connectionString="Server=serveripaddress; Integrated Security=True; Database=arteh3_database;User Id=username;Password=password;" providerName="System.Data.SqlClient"/>
<add name="ASPNETDBConnectionString1" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
This is the source code where error was generated:
public static class ArtHouseConfiguration
{
//cache connection string
private readonly static string dbConnectionString;
//cache data provider name
private readonly static string dbProviderName;
private readonly static string siteName;
//initialize constructor properties
static ArtHouseConfiguration()
{
dbConnectionString = ConfigurationManager.ConnectionStrings["ArtHouseConnection"].ConnectionString;
dbProviderName = ConfigurationManager.ConnectionStrings["ArtHouseConnection"].ProviderName;
siteName = ConfigurationManager.AppSettings["SiteName"];
}
and finally this is the error mg I got:
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 30: static ArtHouseConfiguration()
Line 31: {
Line 32: dbConnectionString = ConfigurationManager.ConnectionStrings["ArtHouseConnection"].ConnectionString;
Line 33: dbProviderName = ConfigurationManager.ConnectionStrings["ArtHouseConnection"].ProviderName;
Line 34:
Source File: d:inetpubvhostsartehouse.orghttpdocsApp_CodeArtHouseConfiguration.cs Line: 32 Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ArtHouseConfiguration..cctor() in d:inetpubvhostsartehouse.orghttpdocsApp_CodeArtHouseConfiguration.cs:32
[TypeInitializationException: The type initializer for 'ArtHouseConfiguration' threw an exception.]
ArtHouseConfiguration.get_EnableErrorLogEmail() in d:inetpubvhostsartehouse.orghttpdocsApp_CodeArtHouseConfiguration.cs:74
Utilities.LogError(Exception ex) in d:inetpubvhostsartehouse.orghttpdocsApp_CodeUtilities.cs:100
ASP.global_asax.Application_Error(Object sender, EventArgs e) in d:inetpubvhostsartehouse.orghttpdocsGlobal.asax:20
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.HttpApplication.RaiseOnError() +182
Anyone got any ideas? thank you!
View 2 Replies
View Related
Apr 24, 2008
Hi, I'm working on a DB and I'm trying to write some select statements that will display an employee's pay using the CAST and CONVERT functions. However, I can never seem to get commas inserted into the results please help. Here's the SELECT statements, where am I going wrong?
SELECT
'$' + CAST(CONVERT(MONEY, SUM(PROJECT_BUDGET/1.00), 1) AS VARCHAR) AS 'Total Budget'
FROM
PROJECT;
View 5 Replies
View Related
Jan 13, 2006
Our database gets updated each week with text files spat out by a mainframe. Previously, the database was in Access; we copied and pasted the text files into Excel, ran macros on them to convert the data, then pasted the results directly into Access and this worked fine for us.
Now that we've moved the tables to SQL Server 2000, we're having problems with the data. We wanted to set up DTS packages for each file to just put them directly into SQL Server. This works for pretty much everything except for the dates.
The way the files are set up, they're comma delimited files with quotes around the text and nothing around the dates. The dates don't have any delimiters; they're just listed like 13012006. Every time we try to import these files into SQL, it gripes about the datatypes; we're trying to put the dates into datetime fields but SQL thinks they're strings. Eek! If we put date delimiters (like 13/01/2006) SQL pulls them in fine, but apparently the mainframe lacks the ability to put these delimiters in by itself and still run everything else OK. The person who writes the extracts has to do it in a language called 'Focus' which I've never heard of and don't know anything about, and he says what I'm asking for can't be done. OK...so now what?
I've tried and tried to convert these strings into dates using both CAST() and CONVERT() and just can't manage to do it. I know I'm missing something really obvious here; does anyone have any tips or advice? Thanks in advance.
View 3 Replies
View Related
Aug 21, 2007
I have a data field that's datatype int and I need to convert it to smalldatetime, however, I get one row erroring out due to a typo in the data that has a date of 21190101. What's wrong with my case statement to set that one typo to 20790101?
'SD' = Case When pro_date > 20790000 Then
pro_date = '20790101'
Else CAST(CAST(pro_date AS VARCHAR) AS SMALLDATETIME) End,
View 4 Replies
View Related
Jun 19, 2006
I hit this error when I run the FTP task. I set IsRemotePathVariable = TRUE and RemoteVariable = User::FTPSourcePath where the variable is set with //DMFTP//PE1.JPG in the script task prior to FTP task.
IsLocalPathVariable also set to TRUE and LocalVariable = User::FTPTempPath where the variable is set to c:BiztalkFTPTemp
The FTP Operation is set to Receive Files.
I have tested the task with IsReportPathVariable to False and it works fine.
Can anyone help me and provide some advise on this? Thank you.
View 2 Replies
View Related
Feb 13, 2008
I cannot find the data type for parameter mapping from Execute SQL Task Editor to make this works.
1. Execute SQL Task 1 - select max(columnA) from tableA. ColumnA is varbinary(8); set result to variable which data type is Object.
2. Execute SQL Task 2 - update tableB set columnB = ?
What data type should I use to map the parameter? I tried different data types, none working except GUI but it returned wrong result.
Does SSIS variable support varbinary data type? I know there's a bug issue with bigint data type and there's a work-around. Is it same situation with varbinary?
Thanks,
-Ash
View 8 Replies
View Related
Dec 7, 2004
Hi,
I need to take a value from a textbox and insert it into a field in my database which takes decimals. My problem, no matter what I try I cannot convert the value so that the database will accept it. This all happens when the submit button is hit on my webpage. Here is the cmdSubmit_click sub code:
Dim surveyNum As Decimal = Decimal.Parse(txtSurveyNum.Text, Globalization.NumberStyles.Number)
myCmd.CommandText = "INSERT INTO survey(ID) VALUES('" & surveyNum & "')"
myCmd.Parameters.Add("surveyNum", SqlDbType.Decimal)
myCmd.Parameters("surveyNum").Value = System.Convert.ToDecimal(txtSurveyNum.Text)
myConn.Open()
Try
myCmd.ExecuteNonQuery()
lblMessage.Text = "Record successfully updated"
Catch
lblMessage.Text = "Query error: " & Err.Description
End Try
myConn.Close()
Thnx in advance, any help would be greatly appreciated.
View 1 Replies
View Related
Sep 18, 2005
Trying to convert the following SELECT statement into a INSERT statement and having trouble. No doubt this will be a piece of cake to someone. To eventually get this to a trigger stage would be nice, but for the moment I'd settle for just plain SQL. Using MS SQL 2000. The database name is reporting. The table name is CallLog. I'm trying to convert seperate date (RecvdDate) and time (RecvdTime) columns into a single DateTime column. I've scoured a lot of web pages but I'm still lost.
==============
use reporting
go
SELECT RecvdDate + RecvdTime FROM [dbo].[CallLog]
===============
Any help much appreciated.
View 7 Replies
View Related
Mar 31, 2005
I am having a bit of trouble with a stored procedure on the SQL Server that my web host is running.
The stored procedure I have created for testing is a simple SELECT statement:
SELECT * FROM table
This code works fine with the query tool in Sqlwebadmin. But using that same code from my ASP.NET page doesn't work, it reports the error "Invalid object name 'table'". So I read a bit more about stored procedures (newbie to this) and came to the conslusion that I need to write database.dbo.table instead.
But after changing the code to SELECT * FROM database.dbo.table, I get the "Invalid object name"-error in Sqlwebadmin too.
The name of the database contains a "-", so I write the statements as SELECT * FROM [database].[dbo].[table].
Any suggestions what is wrong with the code?
I have tried it locally with WebMatrix and MSDE before I uploaded it to the web host and it works fine locally, without specifying database.dbo.
View 2 Replies
View Related
Nov 17, 2007
I have a column which is current stored as nvarchar(10), and all of the enteries are either NULL or mm/dd/yyyy.
I am trying to convert the column to smalldatetime using CONVERT or CAST and each time I get an arithmetic overflow error message.
I also tried selecting just the enteries with ISDATE()=1 and converting those to smalldatetime, and still got an arithmetic overflow message.
(I've run ISDATE() several times on the column, and the only rows without ISDATE()=1 are those which have NULL values).
help!
View 3 Replies
View Related
May 30, 2008
Hi everyone. I am having difficulties with a cursor that I am trying to write. The purpose of the cursor is to loop through all tables in a selected Database and revoke "Select" access to that table for the indicated role (RoleToRevoke). I am getting the error on the @name variable within the REVOKE statement. I have placed a comment indicating where I am getting the error. Is there a way to have sql server interpret this @name variable within the REVOKE statement? Thanks for your help.
Code Snippet
USE [Database_Name];
Declare cursorExample Cursor for
Select TABLE_NAME
from information_schema.tables
Where TABLE_TYPE='Base Table'
and TABLE_SCHEMA='dbo'
Declare @name as varchar(255)
Declare @ErrorSave as int
Declare @ErrorCount as int
Open cursorExample
Fetch Next from cursorExample into @name
SET @ErrorSave = 0
SET @ErrorCount = 0
Begin Tran
While @@Fetch_Status=0
Begin
--Getting Error on Line below on @name
REVOKE SELECT ON OBJECT::@name FROM RoletoRevoke;
IF (@@ERROR <> 0)
BEGIN
Print 'Error Revoking Access to Table: ' + CAST(@name AS varchar(75))
SELECT @ErrorCount = @ErrorCount + 1
END
IF (@@ERROR = 0)
BEGIN
Print 'Successful Revoking Select Rights on Table: ' + CAST(@name AS varchar(75))
SELECT @ErrorSave = @ErrorSave + 1
END
Fetch Next from cursorExample into @name
End
IF @ErrorCount = 0
BEGIN
COMMIT TRAN
PRINT 'COMMITTED TRANSACTION'
PRINT 'Total Tables Affected:' + CAST(@ErrorSave AS varchar(75))
END
ELSE
BEGIN
ROLLBACK TRAN
PRINT 'ROLLED BACK TRANSACTION'
END
Close cursorExample
Deallocate cursorExample
GO
View 9 Replies
View Related
Mar 2, 2007
I have 3 Execute SQL tasks to find the max value of some fields. In two tasks the SQL
SELECT MAX(field bigint)
FROM TABLE
Is returned and stored as a string variable. My 3rd execute SQL task is
SELECT MAX(field int)
FROM TABLE
Is returned and stored as an object type. If I try to save it as a string, the execution fails with a mismatch.
WHY? Why aren't they all strings? What am I missing/doing wrong? This is very frustrating behavior. The queries are running against tables on SQL Server 2005 the field types are listed in the SQL above.
Thanks,
Matt
View 7 Replies
View Related
Sep 7, 2007
I am learning SSIS, and am trying to save the XML output from a SQL task executing a stored procedure. I need to either save it to a .xml file, then FTP the .xml file to an external server, or do the reverse (FTP, then save file.) I can't get past the SQL task so that it works with the File System Task, or the FTP task.
Here is the stored procedure
Create Procedure [dbo].[HRGCSpace]
(@HRGSpace nvarchar(max) = ''Output)
as
Begin
Set NOCOUNT On
set @HRGSpace = (select
CustomerNumber 'CustomerNumber/@id',StartDate 'StartDate/@id', EndDate 'EndDate/@id',Action 'Action/@id',
WorkZoneNumber 'WorkZoneNumber/@id',BuildingName 'BuildingName/@id',BuildingFloorPlan 'BuildingFloorPlan/@id',
FloorName 'FloorName/@id',FloorFloorPlan 'FloorFloorPlan/@id',SpaceName 'SpaceName/@id',VacantUnit 'VacantUnit/@id',
SpaceFloorPlan 'SpaceFloorPlan/@id',Address1 'Street/@id',Address2 'Street2/@id',City 'City/@id',
StateProv 'StateProv/@id',ZIPPost 'ZipPosCode/@id',MoveOutDate 'MoveOutDate/@id'
from HRGCvCorrigoUnits
order by BuildingName, SpaceName
For XML Path ('Space'), Root('HRGSpaces'))
End
--------------------------------------
Here is the execute from the SQL Task
DECLARE @HRGSpace nvarchar(max) EXEC HRGCSpace @HRGSpace Output
If I define the SSIS variable User::HRGSpaces as string, Direction = Output, Parameter Name = 0, Parameter Size = 0
, then use in the SQLTask
General ResultSet = None, Bypass Prepare = True, Connection Type = OLE DB, IsQuery Stored Procedure = False,
Parameter Mapping for User::HRGSpaces,Direction = Output, Parameter Name = 0, Parameter Size = 0
the Progress is
"Progress: Executing query "DECLARE @HRGSpace nvarchar(max) EXEC HRGCSpace @HR". - 100 percent complete
Task Execute SQL Task - select the XML Output failed
Error: The wrapper was unable to set the value of the variable specified in the ExecutionValueVariable property.
If I change it so that ResultSet = XML, the Progress is
" [Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_XML".
If I add ResultName = 0, and VariableName= HRGSpaces, I'm back to
"Progress: Executing query "DECLARE @HRGSpace nvarchar(max) EXEC HRGCSpace @HR". - 100 percent complete
Task Execute SQL Task - select the XML Output failed
Error: The wrapper was unable to set the value of the variable specified in the ExecutionValueVariable property."
Leaving the ResultSet = XML, and changing the SSIS variable as Object, the Progress is
" [Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_XML".
Changing the ResultSet back to None, but leaving the variable as Object, the SQL task will successfully execute, but the File System Task with IsSourcePathVariable = True and SourceVariable = User::HRGSpaces when executed errors out with
"[File System Task] Error: Variable "HRGSpaces" is not a string. Error: There were errors during task validation. Validation is completed. Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
So, how to I resolve the Object vs String definition. Any help in getting beyond this is appreciated!
View 4 Replies
View Related
Feb 28, 2007
I am struggling to copy a 2000 DB to 2005 using transfer sql server objects task.
I can get it to work, but without the foreign keys, which I also need.
When also copying the foreign keys, I get the following message:"
[Transfer SQL Server Objects Task] Error: Execution failed with the following error:
"ERROR : errorCode=0 description=There are no primary or candidate keys in the referenced
table 'SVS' that match the referencing column list in the foreign key 'FK_WRM_SVS_WRM_SVS'.
helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}".
Apparently, SQL tries to create a foreign key on the WRM table, while the primary key on SVS is not there yet.
Since it used to work in 2000, I am pretty sure I am doing something wrong. I can harldy believe this is by design.
(By the way, the CopyAllSchemas is set to True).
Can anyone please help?
Regards,
Pipo
View 3 Replies
View Related
Mar 26, 2007
Hi,We have stored proc name proc_test(str nvarchar(30)). So far this prochas been invoked from a .NET application assuming that only Englishcharacter strings will be passed to it. The calls are likeproc_test('XYZ')We now have a requirement for passing Chinese strings as well. Ratherthan changing the calls throughout the application, we would like tohandle it in the stored procedure so that it treats the string as aunicode string. Can we apply some function to the parameter to convertit to unicode so that we don't have to call with an N prefixed to thestring?Thanks,Yash
View 1 Replies
View Related
Oct 5, 2007
All,
I am having difficulty with an SSIS package that is simply to pivot a table, and perform calculations used in reporting.
Background:
A sample set of data is being tested to pivot for reporting purposes. The sample set of data being used is 2226 rows that will pivot to 6 rows having nearly 400 columns.
Problem 1:
This all seems quite simple except that when I try to pivot on one set of data it works perfectly, I try two at a time, again great. However, as I add three or more groups of data from a view (thus creating 3+ pivoted rows) SSIS throws an error of "-1071636293" and points the to the column containing the values to be pivoted. The error output dumps ALL source data rows with the same error code and message, even on data groups that were successfully pivoted and written to the destination DB all with correct mappings (including the noted with the error code)
Running the package on each group of data one set at a time, creating one pivot output row, always works for all data sets without throwing any errors. How is it possible that SSIS would run perfectly on each data set creating one row without any problems/errors/warnings, but when when run on all data at the same time it would fail?
Problem 2:
When running on multiple sets of data creating many pivoted output rows, the error output viewer and log file contain duplicated data rows from the original query. For example if I received the row the pivot id 1001 ONCE in the query from the DB as it is written out to the error file and viewer I see this ID TWICE for each data group. So if each data set were to contain 100 codes to match and I ran this on three data sets, creating an original 300 rows from the db query, the error file and viewer will have 303 rows. This occurs for only different ID's in depending on the data set, but one ID in particular is duplicated for ALL. How could a row be duplicated in the error output in one case but not another when the source data does not contain ANY duplicates?
Problem 3:
When running the package for three sets of data SSIS will note an error and redirect the row to the file I specified with no problem. However, as I run it on 4 or more data sets that cause more errors I receive the message: "The buffer manager attempted to push an error row to an output that was not registered as an error output. There was a call to DirectErrorRow on an output that does not have the IsErrorOut property set to TRUE." Why would the error logging work for one failure but have problems with more?
I am monitoring the package execution by:
1) logging all available output from SSIS to a file.
2) redirecting all errors from the pivot to a file which works only on the small data sets where I am expecting 1-2 rows to be the pivot result.
3) Placing data viewers on all directional arrows from original db query and pivot
Finally, even with all the errors or warnings all data is pivoted as desired and inserted into the destination database as if nothing was wrong, sometimes. Same package, same data, same errors, but delaying the package with breakpoints causes SSIS to either be successful or fail. I'll question that one later as I gather more information.
Any help on one or more of these questions would be a great help...
Thanks.
-1071636293
-1071636293
View 7 Replies
View Related
Nov 7, 2007
I have a fixed-width flat file that I'm importing to a SQL table in a data flow task. The first field is an ID field, of length 12, that I'm told I can assume is an INT datatype. Obviously, it's a little silly to shove an integer that can be a max of 10 digits into a 12 digit field... but that's my situation.
I set the columns on the flat file connection manager to be inputColumnWidth of 12, and datatype of DT_I4. When I try to run the package, I get the error (understandably): The data conversion for column "ID" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
What are my options here? I'm going to assume that even though the width is 12 characters, only an integer will appear in those spaces. I attempted to use a derived column and a type cast, but to no avail. Help would be appreciated... thanks!
View 5 Replies
View Related
Jun 27, 2006
is there a way to query a varbinary column and print the readable char in query analyzer?
thanks in advance!
Ryan
View 3 Replies
View Related
May 3, 2007
Hi guys,I'm currently trying to insert image into my SQL db.
I have tried a number of methods that were posted online, and so far
with no luck.My current code reads: Dim conn As New Data.SqlClient.SqlConnection() conn.ConnectionString = ConfigurationManager.ConnectionStrings("MainDBConnection").ToString conn.Open() Dim cmd As New Data.SqlClient.SqlCommand("SP_SAVEImage", conn) cmd.CommandType = Data.CommandType.StoredProcedure Dim sImageName As New Data.SqlClient.SqlParameter("@sImageName", Data.SqlDbType.VarChar, 50) sImageName.Value = sImageName Dim sImageType As New Data.SqlClient.SqlParameter("@sImageType", Data.SqlDbType.VarChar, 50) sImageType.Value = fileType Dim sImageData As New Data.SqlClient.SqlParameter("@sImageData", Data.SqlDbType.Image, uploadedFile.Length) sImageData.Value = uploadedFile cmd.Parameters.Add(sImageName) cmd.Parameters.Add(sImageType) cmd.Parameters.Add(sImageData) Dim reader1 As Data.SqlClient.SqlDataReader reader1 = cmd.ExecuteReaderRunning
through debug, everything runs up until the last line, where an error
is caught saying : Failed to convert parameter value from a
SqlParameter to a String I reckon it's to do with the input sImageData being input as a byte array - but I can't seem to find a way around it. Any help greatly appreciated!!
View 1 Replies
View Related