I am trying to load some text files to a SQLServer database. My text files are going to have a name like orders_200709.txt. I am trying to use variables and expressions to evaluate the datepart, YYYYMM. The problem I am facing is with the 'Property Expressions Editor'. When I click on the ellipsis ..., I get the editor, but I am not able to add a new expression; not able to view properites etc. Everything is like in a Disable mode. Does anyone know the cause of this?
Is it possible to use a property, say name, of an object ( say the connection object) in the "Property Expression" of that object? I would like to modify the Connection String property of a flat file connection manager to append date to it. To do this I need to be able to use the Name property of the connection manager in the Property Expression editor. How ever I get an error that it does not recognize name, it almost seems to suggest I can only use variables. I find it hard to believe since it seems like common requirement to be able to use properties of an object (connection manager) in modifying other properties of the object. Any help would be greatly appreciated. Thanks.
Is it possible to use a property, say name, of an object ( say the connection object) in the "Property Expression" of that object? I would like to modify the Connection String property of a flat file connection manager to append date to it. To do this I need to be able to use the Name property of the connection manager in the Property Expression editor. How ever I get an error that it does not recognize name, it almost seems to suggest I can only use variables. I find it hard to believe since it seems like common requirement to be able to use properties of an object (connection manager) in modifying other properties of the object. Any help would be greatly appreciated. Thanks.
I may be looking too hard for this but I can't find a way around it.
I have an Expression and in that expression, I want to access a property on the same object (it would be great to get the properties of other objects as well).
Example: I have a flat file connection where I defined the name of the flat file in my ConnectionString. I also have a variable that I have it linked to my dtsConfig which points to the proper folder name at run time.
How can I create an expression similar to this:
@[User::strFolder] + @[Connectionstring]
where @[User::strFolder] is my variable and points to the correct folder for the given server the package is running on and @[Conenctionstring] is my made up name to access the VALUE of the Connectionstring that I have for this flat file.
So if I have the following:
in my connectionstring property: flatfile.txt
in my strFolder derived from dtsConfig at runtime: E:etl_data
I would like my final connectionstring to look as follow:
E:etl_dataflatfile.txt
So far I know I can do it with two variables but it would be great if I could reuse the property values of the current object for my expressions or any other object.
Perhaps this value is available thru the script where I can access "any" property in my dtsx and store it into another variable and then use it. This option at least allows me to reuse code instead of hardcoding table name (connectionstring) into my variables.
Did I make this too difficult and there is a simple way to access an object's property inside the expression builder?
I have been playing with integration services for a few days and at the moment, its up there with my list of software that I find ......painful.
What I am trying to do is read different tables from my one SQL database, then populate my Access database with its data.
I have put a foreach loop which goes through a collection SQL statements that I have entered into it. It first assigns it to a string variable called tablenameVar which contain statements such as "Select * from Terminals". Then the datareader is supposed to execute it based on the connectstring which never changes, and the SQLCommand value which I passed using the variable @[User::tableName]. However when I try to run it, I'm getting this error.
I want to have this query insert a bunch of XML but i get this error...
Msg 128, Level 15, State 1, Procedure InsertTimeCard, Line 117
The name "ExpenseRptID" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
Msg 128, Level 15, State 1, Procedure InsertTimeCard, Line 151
The name "DateWorked" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
What am i doing wrong...Can anyone help me out!! Thanks!!
p.s I know this query looks crazy...
Code Block
IF EXISTS (SELECT NAME FROM sysobjects WHERE NAME = 'InsertTimeCard' AND type = 'P' AND uid=(Select uid from sysusers where name=current_user)) BEGIN DROP PROCEDURE InsertTimeCard END go /********************************************************************************************************* ** PROC NAME : InsertTimeCardHoursWorked ** ** AUTHOR : Demetrius Powers ** ** TODO/ISSUES ** ------------------------------------------------------------------------------------ ** ** ** MODIFICATIONS ** ------------------------------------------------------------------------------------ ** Name Date Comment ** ------------------------------------------------------------------------------------ ** Powers 12/11/2007 -Initial Creation *********************************************************************************************************/ CREATE PROCEDURE InsertTimeCard @DateCreated DateTime, @EmployeeID int, @DateEntered DateTime, @SerializedXML text, @Result int output as declare @NewTimeCardID int select @NewTimeCardID = max(TimeCardID) from OPS_TimeCards -- proc settings SET NOCOUNT ON
-- local variables DECLARE @intDoc int DECLARE @bolOpen bit SET @bolOpen = 0 --Prepare the XML document to be loaded EXEC sp_xml_preparedocument @intDoc OUTPUT, @SerializedXML -- check for error IF @@ERROR <> 0 GOTO ErrorHandler --The document was prepared so set the boolean indicator so we know to close it if an error occurs. SET @bolOpen = 1
--Create temp variable to store values inthe XML document DECLARE @tempXMLTimeCardExpense TABLE ( TimeCardExpenseID int not null identity(1,1), TimeCardID int, ExpenseRptID int, ExpenseDate datetime, ProjectID int, ExpenseDescription nvarchar(510), ExpenseAmount money, ExpenseCodeID int, AttachedRct bit, SubmittoExpRep bit ) DECLARE @tempXMLTimeCardWorked TABLE ( TimeCardDetailID int not null identity(1,1), TimeCardID int, DateWorked DateTime, ProjectID int, WorkDescription nvarchar(510), BillableHours float, BillingRate money, WorkCodeID int, Location nvarchar(50) ) -- begin trans BEGIN TRANSACTION insert OPS_TimeCards(NewTimeCardID, DateCreated, EmployeeID, DateEntered, Paid) values (@NewTimeCardID, @DateCreated, @EmployeeID, @DateEntered, 0) -- check for error IF @@ERROR <> 0 GOTO ErrorHandler
--Now use @intDoc with XPATH style queries on the XML INSERT @tempXMLTimeCardExpense (TimeCardID, ExpenseRptID, ExpenseDate, ProjectID, ExpenseDescription, ExpenseAmount, ExpenseCodeID, AttachedRct, SubmittoExpRep) SELECT @NewTimeCardID, ExpenseRptID, ExpenseDate, ProjectID, ExpenseDescription, ExpenseAmount, ExpenseCodeID, AttachedRct, SubmittoExpRep FROM OPENXML(@intDoc, '/ArrayOfTimeCardExpense/TimeCardExpense', 2) WITH ( ExpenseRptID int 'ExpenseRptID', ExpenseDate datetime 'ExpenseDate', ProjectID int 'ProjectID', ExpenseDescription nvarchar(510) 'ExpenseDescription', ExpenseAmount money 'ExpenseAmount', ExpenseCodeID int 'ExpenseCodeID', AttachedRct bit 'AttachedRct', SubmittoExpRep bit 'SubmittoExpRep') -- check for error IF @@ERROR <> 0 GOTO ErrorHandler
-- remove XML doc from memory EXEC sp_xml_removedocument @intDoc SET @bolOpen = 0
-- commit transaction, and exit COMMIT TRANSACTION set @Result = @NewTimeCardID RETURN 0
-- Error Handler ErrorHandler: -- see if transaction is open IF @@TRANCOUNT > 0 BEGIN -- rollback tran ROLLBACK TRANSACTION END -- set failure values SET @Result = -1 RETURN -1
I am having problems exporting data into a flat file using specific code page. My application has a variable "User::CodePage" that stores code page value (936, 950, 1252, etc) based on the data source. This variable is assigned to the CodePage property of desitnation file connection using Property expression.
But, when I execute the package, the CodePage property of the Destination file connection defaults to the initial value that was set for "User:CodePage" variable in design mode. I checked the value within the variable during runtime and it changes correctly for each data source. But, the property of the destinatin file connection doesn't change and results in an error.
[Flat File Destination [473]] Error: Data conversion failed. The data conversion for column "Column01" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
[DTS.Pipeline] Error: The ProcessInput method on component "Flat File Destination" (473) failed with error code 0xC02020A0. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
If I manually update the variable with correct code page and re-run the ETL, everything works fine. Just that it doesn't work during run-time mode.
I developed a simple custom control flow component which has several read/write properties and one readonly property (lets call it ROP) whichs Get method simple returns the value of a private variable (VAR as string). In the Execute method the VAR has a value assigened. When I put the value of ROP or VAR into MsgBox I can see the correct value. However when I execute the component I can not see the value of the ROP in the property window. I see the property but its value is empty string. For example when I put a breakpoint to postexecute or check the property before click OK in a MsgBox I would expect that the property value would be updated in SSIS as well. Is there a way how to display correct values of custom tasks properties in property window?
Untill recently I had a smooth running SSIS package,but suddenly it throws error syaing "OnError,,,,,,,The result of the expression
"@[User:trTextFileImpDirectory] +"SomeTextStringHere"+ @[User:trANTTextFileName] +(DT_STR,30,1252) @[User:taging_Date_Key]+ "SomeTextStringHere" " on property "ConnectionString" cannot be written to the property. The expression was evaluated, but cannot be set on the property."
I have child SSIS package running under a parent package (through execute package task)
I have few flat file connection managers in child package for text file import , in which I am building text file path dynamically at run time by assigning an expression in connection string property of connection manager. The Expression is as follows
Where @[User:trTextFileImpDirectory] is a variable which contains path of directory containg text files.Value in this variable is assigned at runtime from parent package's variable,which in turns fetch value from a configuration file on local server.
With my current configuration this path has been configured to some other server's directory over network ( I.e my package picks text files from some other servers folder over network)
While "Some string here"+ @[User:trANTTextFileName]" part of file name string.
(DT_STR,30,1252) @[User:taging_Date_Key] Contain the date of processing ,value in this variable is also picked up at run time from parent package variable.
1) So can someone give me some insight into possible reason of failures. 2) Is it possible that problem arises if directory (from which I m picking text files) is assigned password or is there exist some problem in accessing forlders over network ? 3) Or there can be some problem in package configuration at design time( I.e where I m assigning value in variable from parent package vriables)?
The header table row for G4 contains 3 textboxes containing the sums of the contents within G4. The header table row for G4 is visible while it's contents, including the G4 footer table row, is kept invisible until the report user drills down into the group.
When the report user drills down into G4 the footer table row becomes visible and the sums of the contents of the group are displayed for a second time.
At this point I want the sums in the header to be set to invisible when the sums in the footer are made visible by the drilldown.
When I try to reference the hidden property of textbox66 in the G4 footer in order to set the hidden property of header textbox57 in the G4 header I get to this point...
=IIF(reportitems!textbox66.
When it fails to give me an option of choosing the .Hidden property and instead only gives me a .Value.
If I complete the IIF statement manually so that it spells out .....
So my question is, how do I reference the hidden property of one or more textboxes in a group to use as condition checks to set the hidden property of another textbox in that same group?
Thank you for any help you can provide. We are only now beginning to implement reporting services and I have not yet had the chance to research this in greater detail for lack of time.
Hi! I like a new sql editor instead of the query analyzer. The QA dont show the outlining, bracket injuctions and intellilist. Help! Wich editor able this functions?
What do all of you use to create and edit stored procedures? I am looking for a better way to code than to use the default window supplied with Enterprise Manager.
Do most of you use the Query Analyzer? Are there third party products you like using better?
I'm wondering if there's a better SQL Editor than MS Query Analyzer on the market? I like a lot of the functionality provided by QA but want extra stuff like you get in VB6: intelli-sense (sytanx prompting), auto-complete (CTRL+Space provides list of sp's and tables, etc.) plus any other time saving features.
I've tried a few products but nothing quite hits the mark. Is there a program you use and recommend I trial?
Does anyone know if it is possible to use the XML Editor in SQL 2005 to write xml files from scratch? If possible, how is the editor being started? As of my current knowledge, I am only able to start the XML Editor by clicking on the content of a XML data type column within the sql query result pane.
I would like to use SQL client-side reporting in ASP.NET. However, our customer would like to edit the report sometimes, is there any existing graphical editor to edit .rdlc file? Thanks.
I am using SSIS to extract data from sql server and import into MDB file. In the process, under data flow task, I have used OLE DB Source Editor as source. Here i have choosen SQL Command as mode of data population. In the box below i have typed the following statements.
"Exec Site_Address"
I have used many temperory tables in this procedure. When i run this procedure in the query analyzer window i get the desired data which has to be imported to an MDB. After typing the above statements and when i click the button preview i can see the data. But when i click the Columns.... i dont see anything there. I am unable to see any columns there. This is getting to my nerves because, when i use OLE DB as Destination i am unable to map the columns and i get an error.
I dont know how to solve this problem. cannot we map columns in temp tables .... or wat is it ??
Please help me to find a solution.
I will also paste the procedure code that i have used.
Create procedure Site_Address
as
begin
create table #Data_For_Site_Address_Table
(
unitid varchar(20),
city varchar(50),
cust_num varchar(40),
zip varchar(20),
CountryID varchar(20),
CreatedBy varchar(20)
)
-- tblcrdsiteaddress
insert into #Data_For_Site_Address_Table
select distinct * from
(select
(select top 1 fsu.ser_num
from fs_unit fsu
where ca.cust_seq <> 0 and fsu.cust_num = ca.cust_num
order by ca.city desc) as UnitID,ca.city,ca.cust_num,ca.zip,
CASE
WHEN ca.country like 'Luxembourg' THEN 'LU'
WHEN ca.country like 'Deutschland' THEN 'DE'
WHEN ca.country like 'Austria' THEN 'AT'
WHEN ca.country like 'Czech Republic' THEN 'CZ'
WHEN ca.country like 'Denmark' THEN 'DK'
WHEN ca.country like 'CHINA' THEN 'CN'
WHEN ca.country like 'CROATIA' THEN 'HR'
WHEN ca.country like 'Egypt' THEN 'EG'
WHEN ca.country like 'Germany' THEN 'DE'
WHEN ca.country like 'Hungary' THEN 'HU'
WHEN ca.country like 'Jordan' THEN 'JO'
WHEN ca.country like 'Korea, Republic Of' THEN 'KR'
WHEN ca.country like 'Poland' THEN 'PL'
WHEN ca.country like 'Switzerland' THEN 'CH'
WHEN ca.country like 'United Kingdom' THEN 'GB'
ELSE '- N/A -' END AS CountryID, CA.CreatedBy
from custaddr ca
) al
where unitid is not null
Select TT.Unitid as Short_Site_Name, TT.City as Site_Name,'N.A' as Street_Po_Box,TT.Zip as Postal_Code_City, Null as State_Region,
TT.CountryID as CountryID,Null as Zone, Null as Note, TT.CreatedBy as UserID, GetDate() as Date, 'A' as [Action]
If I implement a custom editor by inheriting from UITypeEditor, Can I invoke it at RUN TIME from a standard control other than PropertyGrid, say a comboBox or a button ?
If it is possible, could you please let me know how to do it or could you please direct me to some URL which shows how to do it.
Do I have to create a custom control that inherits from control for doing this ?
Hi. Is there a T-SQL Editor for SQL CE 3.5 in VS 2008 other than the Query Designer?
I'm used to writing and running sql queries using the MSSMSE 2005 query editor and was looking for something similar in the VS 2008 as MSSMSE 2005 can't open sql ce 3.5 db files. I've found the T-SQL Editor (Data->T-SQL Editor) but unfortunately it only seems to work with regular SQL Server databases and not sql compact sdf files.
Am I missing something or is Query Designer the only way to go (I really hate how it messes with my queries and doesn't let me execute only parts of the queries I write :/ )?
I have just installed MS SQL Server 2005 and SQL Server Management Studio Express on my server but when I try to open a MDF file for manual editing I am told no editor exists. Is the software I have installed able to open a MDF file?
Is anyone aware of a tool that will allow users to update the values of a sql table via a web page? What I am looking for is a tool that when given the name of a table will generate a web front end to allow editing of the table.
Hi,I am looking for a good SQL Server Editor which can be used forwritting stored procedures, doing queries etc. It should have featureslike autocomplete and so on. Any recommendations.Thanks !
Trying to through a process together and using the "ForEach Loop" task. When configuring the task and using the ForEach Loop Editor I do not have the "ForEach File Enumerator" in the drop down. Anyone know whats going on or what I need to do to make this appear. I only see 5 selections: ADO, ADO.Net Schema Rowset, Variable, NodeList, and SMO Enumerators. I am also using the SQL 2005 eval with SP1.
I have a custom component that has no editor (i.e. NoEditor=TRUE in DtsPipelineComponent attribute).
This component derives all of its metadata based on the input (hence no editor is needed). What this means is that if the input changes in any way (e.g. the datatype of a column changes) my component will fail validation. That's not a problem, the problem is my Validate() method returns DTSValidationStatus.VS_NEEDSNEWMETADATA but ReinitializeMetaData() is not being called.
I get the familiar warning from the component: Warning 1 Validation warning. Data Flow Task: Normaliser: The component has inconsistent metadata. TestHarness.dtsx 0 0
and when I double-click on the component I get the familiar dialog box: TITLE: Editing Component ------------------------------ The component is not in a valid state. Do you want the component to fix itself automatically? ------------------------------ BUTTONS: &Yes &No Cancel ------------------------------
but when I click on 'Yes', nothing happens. RMD never gets called.
The workaround is to detach and reattach the input (which results in a call to ReinitializeMetadata() ) or set NoEditor=FALSE in DtsPipelineComponent attribute but I'd rather not have to do that because strictly speaking the user has no need to edit the component through advanced properties.
Is there another way around this problem? Is there a way to call RMD on a component that has no editor?
When creating expressions we have access to a list of functions. It is my understanding that while these functions seem to have the same names and parameters as SQL functions, they are not so. They are implemented in the package libraries themselves. It is also my understanding that this function library cannot be extended to add new ones.
Am I correct? If so... why not?
Leaving alone the fact that they follow the same screwy names as SQL (instead of .NET on which SSIS is built on) and what seems to be a limited library (i.e. You have YEAR(), MONTH(), DAY() functions but no HOUR(), MINUTE(), or SEC() functions -- instead you have to use DATEPART())
I mean honestly... a common expression for most people is using date and times for folder and filenames... So instead of a simple .NET type expression of DateTime.ToString("yyyyMMdd") or Format(DateTime.Now, "yyyyMMdd_hhmmss") I end up with the very complex:
Personally I find myself using Script Tasks and Variables to "build" my expressions and just use Expressions to set the property to the variable. (Which I think may defeat the full purpose of expressions.)
Greetings, I am attempting to create a flat file delimited by |. I am using (ISNULL(LIN1_OPT_ADDR) ? "" : LIN1_OPT_ADDR + "| ") to replace the blank address column with the pipe delimiter. So that a row that would consist of:
Customer Number,Name,Address Line1,City,State
12345,ACE HARDWARE INC. ,801 Rockefeller St.,New York, New York 56789,BUILDING SUPPLY INC., ,Wichita, Kansas
Should end up as:
12345|ACE HARDWARE INC.|801 Rockefeller St.|NEW YORK|NEW YORK 56789|BUILDING SUPPLY INC.||Wichita|Kansas
When I run the data flow to create the flat file the file contains the following:
I am confused with Precedence constraint editor regarding Evaluation Operation and Multiple Constraints options. In the Evaluation Operation dropdown list, there are: Expression and Constraint and Expression OR Constraint. Why it still needs LOGICAL AND and LOGICAL OR in the multiple constraints options? Is it clear that Expression and Constraint is "LOGICAL AND" and "Expression OR Constraint" is "LOGICAL OR"?
I have problem here with sql task editor. i have a stored proceedure with 1 input value and 1 output value which needs to be updated in a variable.
stored proc - exec GetRDate ? , ? output
input value is set in a varaible.
I tried giving 1 input and 1 output in the parameter box and result set as fullresultset 1 value for variable -
" failed with the following error: "No disconnected record set is available for the specified SQL statement.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Get Retention Date
what should i give in the parameter and result set