Problems With Mimimum Value For DateTime Package Variable Since SP1
May 5, 2006
Since I've installed SP1 the minimum value for a package variable has changed.
The former version used 12/30/1899 as the minimum value that can be entered.
Now the min value has changed to something about 1960.
During package execution I'd like to distinguish between two states:
1. The Variable has not yet been written to.
2. Any of my executable has written to it.
At the moment I check the value of it to be the minimum value (see above) or not.
So if I develop packages under SP1 I get into trouble.
Any way out of it?
Thanks
Fridtjof
[EDIT] The mindate in C# differs from both date values mentioned above! Consistency? Hum![/EDIT]
View 4 Replies
ADVERTISEMENT
Sep 12, 2006
I have a package variable that is a datetime... how am I able to set the time of that variable? In visual studio on the variables screen if I click on value it brings up a calendar control - I can't seem to edit the time portion of the variable.
When I first click open the variables window it will say 9/1/2006 12:00:00 AM - but as soon as I click on the value box the 12:00:00 AM part will disappear and I can't edit it. I've tried on someone elses PC as well to make sure there isn't something wrong with my visual studio
Ideas?
View 4 Replies
View Related
Aug 29, 2007
Hello,
I have a package variable called LatestTableFileDate that is typed to DateTime. I have an Execute SQL Task that executes the following SQL statement against an MS Access 2000 database table through the OLEDB Jet provider;
SELECT MAX(FileDate) AS MaxFileDate
FROM CollectionData_Access
The statement parses fine. At the moment, the returned value is NULL. I have 'Result Set' set to 'Single Row'. The FileDate column in the Access table is 'Date/Time', and the Format is 'Short Date'.
In the result set properties, I attempt to set the result to the LatestTableFileDate user variable. When I run the task, the task fails, and the following appears on the 'Progress' tab;
[Execute SQL Task] Error: An error occurred while assigning a value to variable "LatestTableFileDate": "Unsupported data type on result set binding 0.".
I searched the forum for this problem, and didn't find anything. Do I need to convert the date in MS Access to a string and set the package variable to a string type, or is there some other way to handle this?
Thank you for your help!
cdun2
View 16 Replies
View Related
Oct 25, 2006
I'm working on an SSIS package that uses a vb.net script to grab some XML from a webservice (I'd explain why I'm not using a web service task here, but I'd just get angry), and I wish to then assign the XML string to a package variable which then gets sent along to a DataFlow Task that contains an XML Source that points at said variable. when I copy the XML string into the variable value in the script, if do a quickwatch on the variable (as in Dts.Variable("MyXML").value) it looks as though the new value has been copied to the variable, but when I step out of that task and look at the package explorer the variable is its original value.
I think the problem is that the dataflow XML source has a lock on the variable and so the script task isn't affecting it. Does anyone have any experience with this kind of problem, or know a workaround?
View 1 Replies
View Related
Jul 19, 2007
Hi friends,
I have a for each loop that populates from a set of flat files into a Sql Server table, I run the Flat file Import via a dts package embedded into Execute DTS 2000 Task. I want to pass the Sourcefile Name that is fetched by the For Each Loop to assign it Global Variable in DTS. how this can be made ?
Thanks
Subhash Subramanyam
View 4 Replies
View Related
Dec 3, 2007
I have created a SSIS package with a Foreach Loop including a Data Flow Task, which in turn include a Row Count component which pass the row count value to variable with package scope. The variable is used in an Execute SQL Task following the Data Flow Task.
The package executes successfully when executed on its own, but when executed as a child from a parent package (which only include an Execute Package Task) the variable from the Foreach Loop becomes NULL.
There are a lot of other variables in the package receiving values dynamically without any problem, the row count variable however is the only variable in the package that receives a value as part of a Data Flow (and used in following tasks within the Foreach Loop).
Why does the variable become Null? For your information, I am using a variable with package scope and no variables from the parent package are used or passed from the child package to the parent package.
(For your information, we are running the 64 bit version)
View 13 Replies
View Related
Dec 26, 2006
We
have one main package from which 7 other child packages are called. We are using
ParentPackage variables to assign values for variables and database connections.
While the values from ParentPackage variable get assigned to some of the
packages properly, to others it doesn€™t assign the value.
For example:
Except for one of the packages the database connection string gets assigned
properly to all other packages.
Similarly, in another package one of the
variables doesn€™t get assigned. In other packages it is assigned properly.
We
have checked all the other property values and they are exactly the same.
We cannot make any head or tail of this erratic behavior.
Please Help.
View 3 Replies
View Related
May 9, 2007
Hi,
I have packages stored in SQL store. I was letting users run the packages from a .net app that I made with
Microsoft.SqlServer.Dts.Runtime
Now I have noticed this causes the packages to run on the client pc cpu, as well as the network traffic is done via the client pc, in my particular case this is slow.
From the doc and in this forum I have found that you can run a package on the Server cpu through sql agent, let packages be run in a sql job. after that you can start a package from an application with the SQL sp_start_job .
But How do you set a user::varibale in a package if you have to start the package from a sql agent job ?
View 5 Replies
View Related
Aug 29, 2001
How to pass datetime as a variable to an sp? Can any one give the syntax??thanks.
View 1 Replies
View Related
May 12, 2004
HI,
I HAVE A PROBLEM WITH A VARIABLE THAT I AM NOT BEEN ABLE TO SORT OUT.
DECLARE @DATE NVARCHAR(100)
SET @DATE = MONTH(GETDATE())
EXEC ('SELECT ' + @DATE)
WHEN I RUN THIS, I HAVE NO PROBLEM AS IT GIVES ME THE ANSWER SAY 5 AS IT IS MAY.
BUT,
WHEN I RUN A VARIABLE CONTAINING DATETIME,
DECLARE @DATE DATETIME
SET @DATE = GETDATE()
EXEC ('SELECT ' + @DATE)
IT GIVES ME AN ERROR :-
"Line 1: Incorrect syntax near '12'. "
IS THERE A WAY THAT I CAN USE DATETIME AS VARIABLE IN THIS CASE.
View 7 Replies
View Related
Jan 18, 2008
Hello,
I have a SP that recevies a date value for a users date of birth called "dob".
However when passing it into the class which contains the Stored procedure it gives an error.
Below is my code
please advice
Thanks
Ehi
1
2 command.Parameters.Add(new SqlParameter("@usernames", SqlDbType.Int, 0, "RegionID"));
3 command.Parameters.Add(new SqlParameter("@username", SqlDbType.VarChar, 20, "username"));
4 command.Parameters.Add(new SqlParameter("@First_Name", SqlDbType.VarChar, 50, "First_Name"));
5 command.Parameters.Add(new SqlParameter("@Last_Name", SqlDbType.VarChar, 50, "Last_Name"));
6 command.Parameters.Add(new SqlParameter("@dob", SqlDbType.Date, 50, "dob"));
7
8 command.Parameters[0].Value = 4;
9 command.Parameters[1].Value = "username";
10 command.Parameters[2].Value = "First_Name";
11 command.Parameters[3].Value = "Last_Name";
12 command.Parameters[4].Value = DateTime.Parse(dob.Text);
HERE IS THE ERROR MESSAGE
Compiler Error Message: CS0103: The name 'dob' does not exist in the current context
Source Error:
Line 40: command.Parameters[2].Value = "First_Name";
Line 41: command.Parameters[3].Value = "Last_Name";
Line 42: command.Parameters[4].Value = DateTime.Parse(dob.Text);
Line 43:
Line 44: int i = command.ExecuteNonQuery();
Source File: c:inetpubwwwrootcellulant1App_Codesignup_data-entry.cs Line: 42
View 7 Replies
View Related
Aug 1, 2007
Hello,
I have a DateTime variable called CurrentDate that needs to reflect the current date, but the date portion only. I checked several functions in the Expression Builder to use with GETDATE() so that I could just get the date portion, but I didn't see anything that really fit. In a SQL query I would normally use CONVERT to do this.
Any ideas?
Thank you for your help!
cdun2
View 4 Replies
View Related
Nov 16, 2007
I was not able to find the solution myself so here I am to ask you.
I'm using an Ole DB Source with the SQL command from variable.
My variable expression needs to look like this:
select * from dbo.fx_function (SomeDateVariable)
My sql server fx_function recieves as a parameter datetime, my variable SomeDateVariable is datetime type.
I tried all different types of cast on @User :: SomeDateVariable but I either can't evaluate the expression or I have errors trying to execute the package.
Any ideas how the expression should look like?
I'll keep trying...
View 8 Replies
View Related
Feb 13, 2007
How can I return a datetime type variable from a stored procedure in SQL Server to C# code?
View 4 Replies
View Related
Mar 30, 2004
CAST a variable into a datetime object
I need to do a CAST(@variable_name as datetime)
this won't work because @variable_name has the following format
'dd/mm/yy hh:mi:ss:mmmAM'
like how do i specify a style for it.
please help..
James : (
View 4 Replies
View Related
Jul 19, 2007
I am having the wrost trouble with this today for some dumb reason...
Please don't suggest any alternates; this is just a quick example, full code is more elaberate.
Today is 07/19/2007
Declare @StartDate DateTime
@StartDate = CONVERT(VARCHAR(10), Month(GetDate()) & "/22/" & Year(GetDate()), 101)
So I want @StartDate = '07/22/2007'
What I need is CDate
View 6 Replies
View Related
Sep 13, 2006
two variables declared in my proc:@DATE_RANGE_START as datetime,@DATE_RANGE_END as datetime,When I execute my SP it takes 34 seconds.When I change the variables to:@DATE_RANGE_START1 as datetime,@DATE_RANGE_END1 as datetime,and add this to my sp:declare @DATE_RANGE_START datetimedeclare @DATE_RANGE_END datetimeset @DATE_RANGE_START = @DATE_RANGE_START1set @DATE_RANGE_END = @DATE_RANGE_END1the SP runs in 9 seconds (which is expected)Passing in '1/1/01' and '1/1/07' respectivly.Everything else is equal and non-important to this problem.Why does it take 34 seconds when I use the variables from the inputparameters?Interesting isn't it.Jeff
View 5 Replies
View Related
Mar 1, 2007
The source table has timestamp column (Modified Date), which gets upated with each modification via an update trigger.
I store the MAX(modifieddate) in a DeltaExtractionHistory Table in the staging database for each extraction or package execution. Then in the next run, I need to pick the coulmns that have a greater datetime, than the last extracted MAX(ModifiedDate) in the DeltaExtractionHistory table for delta processing.
The OLEDB source has the following SQL statement:
SELECT * FROM [dbo].[MyTable] WHERE [ModifiedDate] > ?
with the following parameter:
Parameter 0 : dtLastModifiedDate
dtLastModifiedDate is an SSIS variable of type Datetime. I read the value of MAX(ModifiedDate) in this variable in a SQLExecuteTask prior to running the data flow task that contains the OLEDB source task.
The problem is - instead of extracting greater datetime, it also extracts the MAX(Modifieddate), which was already extracted in the last run. In other words instead of functioning as [ModifiedDate] > ?, it is functioning as [ModifiedDate] >= ?
because of this, the primary key gets violated on the target table. I think this is happening because the date is stored as "2007-03-01 11:56:34.550" in the table, but SSIS variable shows it in the data viewer as "01/03/2007 11:56:34 PM". It truncates the milliseconds and picks the same date again, because it thinks milliseconds .550 is greater than 000. But I am not 100% sure, may be it is only showing this in the dataviewer, but it contains the ms part as well. I tried using
SELECT * FROM [dbo].[MyTable] WHERE [ModifiedDate] > ? AND DATEPART(ms, MODIFIEDDATE) > DATEPART(ms, ?)
But it fails with an error that the provider was not able to parse the SQL and try storing the statement in the SQL variable. I could not succeed in that - the statement never parses with the parameters.
Can someone please help in this.
Thanks
View 8 Replies
View Related
Feb 5, 2004
Hi I'm new to MS SQL and trying to write a very small dynamic stored procedure which is giving me a headache.
What I have is:
CREATE PROCEDURE busy_report
@TableName varchar(255),
@reporteddate datetime=NULL
AS
if @reporteddate is null
select @reporteddate = CURRENT_TIMESTAMP
-- Create a variable @SQLStatement
DECLARE @SQLStatement varchar(255)
SET DATEFORMAT dmy
-- Enter the dynamic SQL statement into the
-- variable @SQLStatement
SELECT @SQLStatement = "SELECT vendor, reporteddate, count(vendor) FROM " +
@TableName + "WHERE reporteddate = ' "
+ @reporteddate + " '"
-- Execute the SQL statement
EXEC(@SQLStatement)
GO
The error I keep getting is:
Server: Msg 8114, Level 16, State 4, Procedure busy_report, Line 0
Error converting data type varchar to datetime.
Any ideas appreciated.
(Edit:)
I've also tried it this way:
CREATE PROCEDURE UK_busy_report
@TableName varchar(255),
@reporteddate datetime=NULL
AS
-- Create a variable @SQLStatement
DECLARE @SQLStatement varchar(255)
SELECT @reporteddate=CONVERT(datetime, @reporteddate)
IF @@ERROR <> 0 BEGIN
/* Do some error processing */
PRINT 'Error Occured' END
ELSE
-- Enter the dynamic SQL statement into the
-- variable @SQLStatement
SELECT @SQLStatement = "SELECT vendor, reporteddate, count(vendor) FROM " +
@TableName + "WHERE reporteddate = ' "
+ @reporteddate + " '"
-- Execute the SQL statement
EXEC(@SQLStatement)
GO
Which gives me the same error!
.logic.
View 5 Replies
View Related
May 7, 2007
HI
can i assign a string column to a date column
string column contain date data.
UPDATE TABLE ENT SET EXPIRE_DATE = PREVIOUS_TRN_VALUE
where EXPIRE_DATE is a datetime column
PREVIOUS_TRN_VALUE is a string column having the value '2007-05-07'
thanks
View 2 Replies
View Related
Aug 12, 2006
I am getting wrong output when assigning a datepart function to a variable. I should get 2006 but instead I get an output 1905.
Below is the code and output. Any help will be greatly appreciated. Thanks
DECLARE @FiscalStartCurrYear datetime
SET @FiscalStartCurrentYear = DATEPART(year, GETDATE())
select @FiscalStartCurrYear
Output
-----------
1905-06-30 00:00:00.0000
View 5 Replies
View Related
Apr 28, 2007
In one step of an SSIS package, i create an outgoing XLS filename based on the current datetime setting, a la:
"myFileName_" + (DT_WSTR,4)YEAR( getdate()) + RIGHT("0" + (DT_WSTR,2)MONTH( getdate()),2)+
RIGHT("0" + (DT_WSTR,2)DAY( getdate()),2) +
RIGHT("0" + (DT_WSTR,2)DATEPART("hh", getdate()),2) +
RIGHT("0" + (DT_WSTR,2)DATEPART("mi", getdate()),2) +
RIGHT("0" + (DT_WSTR,2)DATEPART("ss", getdate()),2) +".xls"
which provides the format as myFileName_yyyymmddhhmmss.xls.
This value is then assigned to a variable, user::myFilenameDateTime.
This variable is referred to in various steps which need the full pathname or filename.
I found, though, that in subsequent steps, the value for user::myFilenameDateTime is re-calculated whenever the variable is invoked.
So in one Task i created the physical output XLS file and named it "correctly", eg, myFileName_20070428090204.xls; in the next Task, i call a Stored Procedure in SQL Server 2005 to email the file with a corresponding message (that pulls in more data from the database).
The single Parameter to the Stored Procedure (that does the emailing) is the supposed/expected full Pathname of the outgoing file just produced but the parameter no longer represents the original filename -- and has changed slightly (a few seconds have been added) and the filename is now, myFileName_20070428090210.xls; consequently, my Email Distribution program cannot find the file with that specific name, although File = myFilename_20070428090204.xls does certainly exist.
so it appears that these variables are calculated realtime whenever encountered.
1) Am I misunderstanding something or misusing the variable assignment?
2) How can i keep << myFileName_yyyymmddhhmmss.xls >>, "static" throughout the duration of the overal SSIS Process.
3) I would think that even if I assign the derived myFileName value initially to ANOTHER "static" variable, this won't achieve anything because the new variable will be re-calculated again, as well, when it is invoked.
thx/spirits,
seth j hersh
View 3 Replies
View Related
Oct 4, 2006
Please help!
I am designing an SSIS package and need to change the value of a DateTime global variable with the value returned from an Execute SQL task. The queary is as follows:
Select Versiondate = dateadd(dd,+1,Max(CreateDate)) from msdb..sysdtspackages p with(nolock)
where name = '@name'
The error message is as follows:
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at VersionDate_Set, Execute SQL Task: Executing the query "Select Versiondate = dateadd(dd,+1,Max(CreateDate)) from msdb..sysdtspackages p with(nolock)
where name = '@name'" failed with the following error: "The type of the value being assigned to variable "User::VersionDate" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: VersionDate_Set
SSIS package "Package.dtsx" finished: Success.
The variable is set to data type DateTime, but the value will not change. Any ideas?
View 1 Replies
View Related
Apr 28, 2008
I'm looking at http://blogs.conchango.com/jamiethomson/archive/2007/03/13/SSIS_3A00_-Property-Paths-syntax.aspx and http://blogs.conchango.com/jamiethomson/archive/2005/10/11/SSIS_3A00_-How-to-pass-DateTime-parameters-to-a-package-via-dtexec.aspx trying to understand where we are at using datetime overrides in ssis from the command line. One of these articles suggests something has been fixed in ssis sp1, what part of this issue was fixed?
Can you override (from the command line) a user var in ssis whose ValueType property is datetime? Or do some of the older articles still apply, ie the user var must be string so that ssis wont create a separate user var with the same name etc etc? And if it is string, does some kind of conversion need to be done to compare it against datetime cols in t-sql inside the pkg?
I already know that the syntax is
dtexec /F Package.dtsx /SET Package.Variables[User::Var].Properties[Value];2007-01-02.
If this has been fixed, was it fixed in service pack 1, 2?
View 1 Replies
View Related
Jun 11, 2015
I have created one variable name migration_start datetime which give me default format of 6/11/2015 1:26 AM...But I expecting to get in 2015-06-11 01:26:22.813 format.I have used below expression betting getting issue with that
(DT_STR, 4, 1252) DATEPART("yyyy" , @[User::migration_start]) + "-" + RIGHT("0" +
(DT_STR, 2, 1252) DATEPART("mm" , @[User::migration_start]), 2) + "-" + RIGHT("0" + (DT_STR, 2, 1252) DATEPART("dd" , @[User::migration_start]), 2)
View 5 Replies
View Related
Jun 12, 2006
Hello,
I'm attempting to pass a datetime variable to a stored proc (called via sql task). The variables are set in a previous task where they act as OUTPUT paramters from a stored proc. The variables are set correctly after that task executes. The data type for those parameters is set to DBTIMESTAMP.
When I try to exectue a similar task passing those variables as parameters, I get an error:
Error: 0xC002F210 at ax_settle, Execute SQL Task: Executing the query "exec ? = dbo.ax_settle_2 ?, ?,?,3,1" failed with the following error: "Invalid character value for cast specification". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
If I replace the 2nd and 3rd parameters with quoted strings, it is successful:
exec ?= dbo.ax_settle ?, '3/29/06', '4/30/06',3,1
The stored proc is expecting datetime parameters.
Thanks for the help.
Mike
View 3 Replies
View Related
Jun 12, 2015
I am using Execute sql task in my SSIS package, and I am trying to make the following query:
<o:p></o:p>
Select max(sqlid) from archive.dbo.Archivebbxfbhdr
where timein <= ?<o:p></o:p>
Where ? is my input parameter variable migration_start which is a datetime.<o:p></o:p>
My issue is that variable name migration_start which give me default format of 6/11/2015 1:26 AM
But I expecting to get in 2015-06-11 01:26:22.813 format.<o:p></o:p>
How I can I change the datetime format of my variable to be (yyyy/mm/dd)hh:mm:ss)?<o:p></o:p>
View 3 Replies
View Related
Nov 1, 2007
I need to set a variable to datetime and time to exact milliseconds in SQL server in stored procedure.
Example:
set MyUniqueNumber = 20071101190708733
ie. MyUniqueNumber contains yyyymmddhhminsecms
Please help, i tried the following:
1. SELECT CURRENT_TIMESTAMP; ////// shows up with - & : , I want single string as in above example.2.
select cast(datepart(YYYY,getdate()) as varchar(4))+cast(datepart(mm,getdate()) as char(2))+convert(varchar(2),datepart(dd,getdate()),101 )+cast(datepart(hh,getdate()) as char(2))+cast(datepart(mi,getdate()) as char(2))+cast(datepart(ss,getdate()) as char(2))+cast(datepart(ms,getdate()) as char(4))
This one doesnot display day correctly, it should show 01 but shows 1
View 2 Replies
View Related
Aug 3, 2006
hi !
how to set variable value for sub package inside another package?
some thing like this:
xp_cmdshell 'dtexec /f "D:\SSISProject\Integration Services Project1\ArchiveMainMultiTables.dtsx" /Set package.Variables[User::ArchivePackageName].Properties[Value];"ArchiveTicketLog" /Set package.Variables[User::ArchiveFileType].Properties[Value];"text" /Set package.Variables[User::connectst].Properties[Value];"Data/tSource=SE413695AASQL2005;Initial/tCatalog=TestDB;Provider=SQLNCLI.1;Integrated/tSecurity=SSPI;[ConnectionString]'
Main Package = ArchiveMainMultiTables.dtsx
sub packge = ArchiveTicketLog. when i try to execute the sub pacakge it thorughs up error saying the connection string in not set. i am setting in the parent connection string of the main package. when i execute through the pacakge itself it works fine but when i execute through the Sql command line it fails.
is there some thing to to "/Set [package name]Package.Connections[ConnectStringArchiveTicket].Properties[Value];
please help
thanks
jas
View 4 Replies
View Related
Feb 21, 2007
Hi,
I have created a DTS Package which copies data from a Access Database table to a SQL Server table. The DTS Package is scheduled to execute every 15 minutes. Everyday the source table name will change. Is there a way to reset the source table name everyday without changing it through DTS wizard.
Thanks,
Vivek Gupta
View 1 Replies
View Related
Nov 20, 2001
I have a SQL 7 package which uses a select statement. Within the the select statement is
a where clause. I would like to define a string variable for the object of the where clause. I would
like to have this string variable passed into the package just prior to execution of the package.
Anyone know how to do this?
Thanks in advance for the help!!!!!
Gary Andrews
andrews_gary_w@solarturbines.com
View 2 Replies
View Related
Apr 2, 2008
Hi everyone,
I have a weird issue. I open my SSIS project up and I have to date package variables. (startdate and enddate)
Now when I open the project they are set
startdate = '2/1/2008' and enddate '3/1/2008'
I change the two dates and save the project.
When I run the project in debug the values aren't being picked up. its the original dates above.
I save the project with changed values and reopen the project and I get the old dates come back.
Any ideas?
Thanks in advance.
View 4 Replies
View Related
Jun 12, 2007
I have a package with variable "A" defined at the package level, type "string".
I subsequently reference variable "A" in a script task, as a ReadWrite variable. In the script, I simply assign the value of another string variable to variable "A".
However, when I run the package, I *intermittently* receive the error below. Not every time though, sometimes it runs fine without the error. What's going on here?
Thanks
Error msg:
The type of the value being assigned to variable differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
Code:
Public Sub Main()
Dim newestFile As String
.....................
.....................
Dts.Variables("A").Value = newestFile
Dts.TaskResult = Dts.Results.Success
End Sub
View 6 Replies
View Related