String Manipulation From Flat File Into Database

Jan 9, 2008



Hi

I'm used to DTS but new to SSIS. What's a good reference/tutorial that deals with transforming columns of data (from a flat file) from one format to another when uploading into SQL2005? Typically columns of data have "" around the values and spaces that I want to remove.

Presumably in SSIS I need the following:

A Data flow task containing:

Flat file source
Derived or Copy Column?
OLE DB Destination

Is this on the right track?

Thanks
Gerry

View 1 Replies


ADVERTISEMENT

Exported Flat File Data Will Not Import To Same Table Without Extensive Data-type Manipulation

Jul 13, 2007

I'm moving data between identical tables and have to use a flat file as an intermediary. I thought: "No problem, SSIS can do a quick export to a file, then move the file to another server, then use SSIS to import the data to the new server."



Seems simple, right?



I'm hitting all sorts of surprising data conversion errors. I used the export wizard to create the export package. This works fine. However using the same flat file definition, the import package fails -- even when I have no destination. That is I have just one data flow task that contains only one control: the Flat File source. When I run the package the flat file definition fails with data type conversion and truncation errors. One of the obvious errors is for boolean types. The SQL field is a bit, SSIS defined the column as DT_BOOL, the output of the data are literal text values "TRUE" and "FALSE". So SSIS converts a sql datatype of bit to "TRUE" and "FALSE" on export, but can't make the reverse conversion on import?



Does anyone else find this surprising? I would expect that what SSIS exports, it can import given all the same table and flat file definitions. Is SSIS the wrong tool to do such simple bulk copies? I'd like to avoid using BCP because this process will need to run automatically within SQL Agent so we can leverage all the error tracking and system monitoring.



View 12 Replies View Related

Import Flat Text File String Date To Database Date

Jan 30, 2007

I asked this question below, but the answer was that the conversion will take place automatically, but I can't get that to happen. I have a flat file with an 8 position field that I identify as string (and I also tried date) that is yyyymmdd and it needs to go into the database field that is datetime format. IS there something I am doing wrong with the definition of it, or do I need to add some kind of conversion, and if so, what and how would that be done. I'm a dts Sql2000 expert, but the SSIS thing is driving me crazy. I have a ton of dts' to convert and the migration tool doesn't work because there are a lot of active X scripts in them. thanks for your help. Boston Rose

View 1 Replies View Related

Need Help With String Manipulation - Splitting 1 String Into Multiple Columns

Sep 11, 2006

Hello All,

I'm a non-programmer and an SQL newbie. I'm trying to create a printer usage report using LogParser and SQL database. I managed to export data from the print server's event log into a table in an SQL2005 database.

There are 3 main columns in the table (PrintJob) - Server (the print server name), TimeWritten (timestamp of each print job), String (eventlog message containing all the info I need). My problem is I need to split the String column which is a varchar(255) delimited by | (pipe). Example:

2|Microsoft Word - ราย�ารรับ.doc|Sukanlaya|HMb1_SD_LJ2420|IP_192.10.1.53|82720|1

The first value is the job number, which I don't need. The second value is the printed document name. The third value is the owner of the printed document. The fourth value is the printer name. The fifth value is the printer port, which I don't need. The sixth value is the size in bytes of the printed document, which I don't need. The seventh value is the number of page(s) printed.

How I can copy data in this table (PrintJob) into another table (PrinterUsage) and split the String column into 4 columns (Document, Owner, Printer, Pages) along with the Server and TimeWritten columns in the destination table?

In Excel, I would use combination of FIND(text_to_be_found, within_text, start_num) and MID(text, start_num, num_char). But CHARINDEX() in T-SQL only starts from the beginning of the string, right? I've been looking at some of the user-defind-function's and I can't find anything like Excel's FIND().

Or if anyone can think of a better "native" way to do this in T-SQL, I've be very grateful for the help or suggestion.

Thanks a bunch in advance,

Chutikorn

View 2 Replies View Related

Get Flat File Source Connection String At Run Time

Apr 12, 2007

I have a simple package, which reads a flat file source, does some transformation, and outputs to a flat file destination. The package runs as a SQL Agent job, so I have the flat file source and OLEDB connection ticked and configured on the data sources tab.

What I would like to do is get hold of the flat file source connection string property from inside the package at run time, and use it to set the flat file destination connection string using property expressions.

The easy option is to set the destination in the agent job, but I'd like to add a date/time stamp to the destination filename.

Is this possible?

Thanks,

Greg.

View 1 Replies View Related

Dynamically Populate Flat File Connection String

Mar 12, 2008

Hi,
I tried to follow the widely talked about method to dynamically populate the connection string property of my flatfileconnection manager from a variable. I keep getting the following non-fatal error.

TITLE: Microsoft Visual Studio
------------------------------

Nonfatal errors occurred while saving the package:
Error at Package [Connection manager "FFCM"]: The file name ""C:ProjectsSSISHLoadTOutputOut.csv"" specified in the connection was not valid.

Error at Package: The result of the expression "@[User::CsvFullFileName]" on property "ConnectionString" cannot be written to the property. The expression was evaluated, but cannot be set on the property.


Here is what I am trying to do.
I have a foreach loop that iterates through a list of xml config files and reads the config information including the destination csv file name and does a data transformation.
So I created a flatfile connection to a csv file did my data mappings.
Created a package level variable to hold the destination file path
In the Flat file conn. manager's properties -> expression -> set the @[User::CsvFullFileName] (which even evaluates fine)

When I try to run the package I keep getting the above mentioned non-fatal error..I checked the path and it is valid. I even tried

the c:\projects\...notation and the UNC path notation...all seem to give the same error


Anyone experience this before ? any thoughts would be appreciated.

Thanks

View 5 Replies View Related

Assigning A Particular Flat File Record To A String Variable

Jun 12, 2007

Hey all!

Okay, can I assign line x of a flat file to a variable, parse that line, do my data transformations, and then move on to line x+1?

Any thoughts?

In other words, I'm looking at using a for loop to cycle through a flat file. I have the for loop set up, and the counter's iterating correctly. How do I point at a particular line in a flat file?

Thanks for any suggestions!

Jim Work

View 5 Replies View Related

Flat File Connection Manager And String Delimitation

Jul 14, 2006

Guys

Another question regarding the frustrating SSIS stuff. Basically when I used to use a DTS task to import a flat file (comma delimited) into the database it worked fine no problems, however, for some reason the same approach in SSIS means that any string values in the file are automatically delimited with double quotes, even though I am specifying <none> as the delimitation. I have also changed the fields so that the the TextQualified is set to false.

This causes a problem because all of the information stored in the database (done by a stored procedure) contains these stupid quotes.

Is there something I am missing or haven't done correctly to get rid of the quotes

Thanks

D

View 7 Replies View Related

Transact SQL :: Flat Text File - Separate HTML String

Jun 24, 2015

I have a flat text file with lots HTML tags and corresponding values 

For example 
<Near_Side> 5563 </Near_Side>
<Top_Down_Code> Xe345 <Top_Down_Code> 

So, For example I can use the a function 

ALTER function dbo.StripHTML( @text varchar(max) ) returns varchar(max) as
begin
    declare @textXML xml
    declare @result varchar(max)
    set @textXML = REPLACE( @text, '&', '' );

[Code] ...

To which Select dbo.StripHTML('<Near_Side> 5563 </Near_Side>')  Value 

I'll get 5563

However how would you get the values within the tag itself ? E.g. 

Value Name 
5563 Near_side
Xe345      Top_Down_Code

I was thinking along the Charindex but cant seem to get it right.

View 4 Replies View Related

SSIS-problems Making A Dynamic Flat File Connection String

May 8, 2007

Hello.

I have packages that must generate log errors dynamically including time of execution and the name of the task.

I make it changing the properties of the connection inserting two expressions.

1.-I alter the File Usage Type to 1 to generate this files.
2.- I alter the connection string as: @[User::myvariable] +"constant_description"+ time description+ +".txt"

The time description is :
(DT_STR,40,1252) DAY (GETDATE())+"-"+(DT_STR,40,1252) MONTH( GETDATE())+"-"+(DT_STR,40,1252) YEAR( GETDATE())+" + REPLACE( (DT_STR,10,1252) (DT_DBTIME) GETDATE(),":","_")
But it is not the problem

In those packages I have one connector for all the tasks and in execution time it creates one file for each of the tasks.

The problem is the way I insert in the filename the task name.

I have a pre-execute event handler in each task that modifies a string variable( myvariable) appending the task name. When I execute de package it works great but when I only execute a task, the program do not enter in the event and do not put the task’s name.

How can I put that name without using that handler? There is another handler can I use to do it that happens before the system generates the new file name and after pre-execute? Anyone knows another way to do this kind of things?

View 3 Replies View Related

Default To NULL Instead Of Blank/empty String During Flat File Import

Aug 15, 2006

Hi,

In SSIS flat file import using fastload, I'm trying to import data into SQL 2005 previously created tables.

The table may contain column that are NULLable BUT there is NO DEFAULT for them.

If the incoming data from flat files contains nothing either between the delimeters, how can I have a NULL value inserted in the column instead of blank/empty string?

I didn't find an easy flag unless I'm doing something wrong. I know of at least two ways to do it the hard way:

1- set the DEFAULT(NULL) for EVERY column that needs this behaviour

2-set up some Derived Column option in the package to return NULL if the value is missing.

Both of the above are time consuming since I'm dealing with many tables. Is there a quick option to default the value to NULL WHEN there is NO data ELSE insert the data itself? So the same behavior that I have right now except that I want NULL in place of empty string/blank in the varchar(x) columns.



Thanks

Anatole

View 9 Replies View Related

Unable To Edit Pre-defined Flat File Connection Manager Properties In The Flat File Destination Editor

Aug 24, 2007

Hi,

I am testing SSIS and have created a Flat File Destination. I defined the Flat File Connection as New for the first time and it worked fine. Now, I would like to go back and modify the Flat File Connection in the Flat File Destination Editor, but it allows only to create a New connection rather allowing me to edit the existing one. For testing, I can go back and create a new connection, but if my connection had 50-100 columns then it would be an issue to re-create it from scratch.

Did someone else faced this issue?


Thanks,
AQ

View 1 Replies View Related

String Manipulation

Apr 2, 2001

I am totaly confused please help

I am trying to change a tring of 7 characters of the format "XXYZZZZ" to be
"XX0YZZZZ" I wonder if any body has any idea

Also how can get an out of a dattime field in the format of DDMMYYYY and converted into text.

You help is highly appreciated

View 1 Replies View Related

STRING MANIPULATION

May 15, 2001

Hi!

I am using the follwing query for extracting the country name and city in a COLUMN [Destination Name] in Destinations table. The Data in the table looks like:

CANADA - Toronto
United States- ARIZONA
France
Argentina
United States (USA)- ARIZONA
........
........

The folowing query is producing the required results upto soem extent but without using -1 in subtracting the one value of CHARINDEX. The error is:

Server: Msg 536, Level 16, State 4, Line 1
Invalid length parameter passed to the substring function.
The statement has been terminated.

QUERY
-----
select

Left(
Destinations.[Destination Name],
charindex("-", Destinations.[Destination Name])-1
)
as test
into temp2
from destinations

CAN ANYBODY HELP me in extracting the city an dcoutry name. I also want to delete the name in () like (USA).

View 1 Replies View Related

String Manipulation ?

Nov 30, 2004

I was given a script that was supposed to take a name field that was separated by commas and normalize it into last, first and middle name. My data looks like below in one fieldname called longname

crab,mike,Allen
Lota Weilly,Eric,M

My script to do this looks like

update ailoca
set last_name = substring (longname, 1, patindex( '%,%' , longname) -1 ),
first_name = substring (longname, patindex( '%,%' , longname) + 1, patindex( '% %', longname)-patindex( '%,%' , longname)),
middle_name = substring (longname, patindex( '% %', longname) + 1, len(longname)-patindex( '%,%' , longname))

My problem is that some people actually have 2 last names, not hyphenated, but 2. Whenever I have 2 names I get the following error

Server: Msg 536, Level 16, State 3, Line 1
Invalid length parameter passed to the substring function.
The statement has been terminated.

It seems to be related to the first name, I can comment out that update and it works

Thanks
Thanks

View 11 Replies View Related

String Manipulation

Jul 24, 2007

Hi All,

I am trying to break the string that looks like this


2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.

into three separate strings to look like this

col1 col2 col3
2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.


I was able to separate the above string into two columns, but can't figure out how to put the rest of the string into the third column.

Any help is appreciated.

Thanks.

View 2 Replies View Related

String Manipulation

Nov 13, 2005

Field1 = Dominguez Public Transport Division 03 9320 4326

how do i remove these strings in T-SQL

Field1 = Dominguez
Field2 = Public Transport Division
Field3 = 03 9320 4326

View 3 Replies View Related

String Manipulation

Jul 24, 2007

Hi All,

I am trying to break the string that looks like this


2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.

into three separate strings to look like this

col1 col2 col3
2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.


I was able to separate the above string into two columns, but can't figure out how to put the rest of the string into the third column.

Any help is appreciated.

Thanks.

View 3 Replies View Related

String Manipulation

May 3, 2008

Sir

How i m Manipulate String , I have
(ABC,XYZ,EFG) this string
know i want to break this string 1 by 1 and modify and then rearrange in same form ang Get

like (ABCWE,XYZRT,EF)
pls help me out

Yaman

View 2 Replies View Related

String Manipulation

May 29, 2008

Hi
I have a field which is a file path
like
'C:avde8393948.txt'

I want to separate them into folder and filename
now the filename is always the same length,
so i can use RIGHT to get the filename,
but i prefer a method that from the right detects the
1st occurance of and everything after is the filename,

View 2 Replies View Related

String Manipulation

Aug 29, 2007

Hi If i have a string like :

AX4030303022

in one field and need to split it into

AX 030303022

I can use LEFT(field_name,2) for the 1st one, but
what can i use for the 2nd ?
and how can i deal with NULLS ?
if its NULL i want a blank space..

View 16 Replies View Related

String Manipulation SQL

Jul 20, 2005

We have some rows that we need to do some tricky string manipulationon.We have a UserID column which has userid entries in the formatfirstname.lastname and i need to change each entry tolastname.firstnameCan this be done by some script?Thanks so much for your help.Sid

View 3 Replies View Related

String Manipulation

Aug 13, 2007

Hi all,

I am having problem in string manipulation in SSIS - Derived Column Transformation.
I am trying to extract the OU names from Active Directory objects into a SQL table.

Assume that a distinguish name (DN) of an object as below:
CN=John, Doe,OU=Users,OU=SubOU,OU=ParentOU,DC=domain,DC=company,DC=com

How can I manipulate the above string so that I get:
ParentOU/SubOU/Users

Thanks in advance. Help is much appreciated!

View 8 Replies View Related

Flat File Connection Manager Throws Error When A Column Gets Added To The Flat File

Dec 27, 2006

Hi,

I have a situation where a tab limited text file is used to populate a sql server table.

The tab limited text file comes from a third party vendor. There are fixed number of columns we need to export to the sql server table. However the third party may add colums in the text file. Whenenver the text file has an added column (which we dont need to import) the build fails since the flat file connection manager does not create the metadata for it again. The problem goes away  where I press the button "Reset Columns" since it builds the metadata then. Since we need to build the tables everyday we cannot automate it using SSIS because the metadata does not change automatically. Is there a way out in SSIS?

View 5 Replies View Related

Output Column Width Not Refected In The Flat File That Is Created Using A Flat File Destination?

May 11, 2006

I am transferring data from an OLEDB source to a Flat File Destination and I want the column width for all of the output columns to 30 (max width amongst the columns selected), but that is not refected in the Fixed Width Flat File that got created. The outputcolumnwidth seems to be the same as the inputcolumnwidth. Is there any other setting that I am possibly missing or is this a possible defect?

Any inputs will be appreciated.

M.Shah

View 3 Replies View Related

How Do I Insert Data From A Flat File Or .csv File Into An Existing SQL Database???

Mar 29, 2006

How do I insert data from a flat file or .csv file into an existing SQL database???

Here what I've come up with thus far and I but it doesn't work. Can someone please help? Let me know if there is a better way to do this... Idealy I'd like to write straight to the sql database and skip the datset all together...

strSvr = "vkrerftg"

StrDb = "Test_DB"

'connection String

strCon = "Server=" & strSvr & ";database=" & StrDb & "; integrated security=SSPI;"

Dim dbconn As New SqlConnection(strCon)

Dim da As New SqlDataAdapter()

Dim insertComm As New SqlCommand("INSERT INTO [Test_DB_RMS].[dbo].[AIR_Ouput] ([Event], [Year], [Contract Loss],[Company Loss], " & _

"[IndInsured Loss Prop],[IndInsured Loss WC],[Event Info]) " & _

"VALUES (@Event, @Year, @ConLoss, @CompLoss, @IndLossProp, @IndLossWC, @eventsInfo)", dbconn)

insertComm.Parameters.Add("@Event", SqlDbType.Int, 4, "Event")

insertComm.Parameters.Add("@Year", SqlDbType.Float, 4, "Year")

insertComm.Parameters.Add("@ConLoss", SqlDbType.Float, 4, "Contract Loss")

insertComm.Parameters.Add("@CompLoss", SqlDbType.Float, 4, "Company Loss")

insertComm.Parameters.Add("@IndLossProp", SqlDbType.Float, 4, "IndInsured Loss Prop")

insertComm.Parameters.Add("@IndLossWC", SqlDbType.Float, 4, "IndInsured Loss WC")

insertComm.Parameters.Add("@eventsInfo", SqlDbType.NVarChar, 255, "Event Info")

da.InsertCommand = insertComm

Dim upComm As New SqlCommand("UPDATE [Test_DB_RMS].[dbo].[AIR_Ouput] " & _

"SET [Event] = @Event " & _

",[Year] = @Year " & _

",[Contract Loss] = @ConLoss " & _

",[Company Loss] = @CompLoss " & _

",[IndInsured Loss Prop] = @IndLossProp " & _

",[IndInsured Loss WC] = @IndLossWC " & _

",[Event Info] = @EventInfo", dbconn)

upComm.Parameters.Add("@Event", SqlDbType.Int, 4, "Event")

upComm.Parameters.Add("@Year", SqlDbType.Float, 4, "Year")

upComm.Parameters.Add("@ConLoss", SqlDbType.Float, 4, "Contract Loss")

upComm.Parameters.Add("@CompLoss", SqlDbType.Float, 4, "Company Loss")

upComm.Parameters.Add("@IndLossProp", SqlDbType.Float, 4, "IndInsured Loss Prop")

upComm.Parameters.Add("@IndLossWC", SqlDbType.Float, 4, "IndInsured Loss WC")

upComm.Parameters.Add("@EventsInfo", SqlDbType.NVarChar, 255, "Event Info")

da.UpdateCommand = upComm

da.Update(dsAIR, "TextDB")



************* ANY HELP WOULD BE GREATLY APPRECIATED************

THANKS

View 6 Replies View Related

How Do I Insert Data From A Flat File Or .csv File Into An Existing SQL Database???

Mar 29, 2006



How do I insert data from a flat file or .csv file into an existing SQL database???

Here what I've come up with thus far and I but it doesn't work. Can someone please help? Let me know if there is a better wway to do this... Idealy I'd like to write straight to the sql database and skip the datset all together...

strSvr = "vkrerftg"

StrDb = "Test_DB"

'connection String

strCon = "Server=" & strSvr & ";database=" & StrDb & "; integrated security=SSPI;"

Dim dbconn As New SqlConnection(strCon)

Dim da As New SqlDataAdapter()

Dim insertComm As New SqlCommand("INSERT INTO [Test_DB_RMS].[dbo].[AIR_Ouput] ([Event], [Year], [Contract Loss],[Company Loss], " & _

"[IndInsured Loss Prop],[IndInsured Loss WC],[Event Info]) " & _

"VALUES (@Event, @Year, @ConLoss, @CompLoss, @IndLossProp, @IndLossWC, @eventsInfo)", dbconn)

insertComm.Parameters.Add("@Event", SqlDbType.Int, 4, "Event")

insertComm.Parameters.Add("@Year", SqlDbType.Float, 4, "Year")

insertComm.Parameters.Add("@ConLoss", SqlDbType.Float, 4, "Contract Loss")

insertComm.Parameters.Add("@CompLoss", SqlDbType.Float, 4, "Company Loss")

insertComm.Parameters.Add("@IndLossProp", SqlDbType.Float, 4, "IndInsured Loss Prop")

insertComm.Parameters.Add("@IndLossWC", SqlDbType.Float, 4, "IndInsured Loss WC")

insertComm.Parameters.Add("@eventsInfo", SqlDbType.NVarChar, 255, "Event Info")

da.InsertCommand = insertComm

Dim upComm As New SqlCommand("UPDATE [Test_DB_RMS].[dbo].[AIR_Ouput] " & _

"SET [Event] = @Event " & _

",[Year] = @Year " & _

",[Contract Loss] = @ConLoss " & _

",[Company Loss] = @CompLoss " & _

",[IndInsured Loss Prop] = @IndLossProp " & _

",[IndInsured Loss WC] = @IndLossWC " & _

",[Event Info] = @EventInfo", dbconn)

upComm.Parameters.Add("@Event", SqlDbType.Int, 4, "Event")

upComm.Parameters.Add("@Year", SqlDbType.Float, 4, "Year")

upComm.Parameters.Add("@ConLoss", SqlDbType.Float, 4, "Contract Loss")

upComm.Parameters.Add("@CompLoss", SqlDbType.Float, 4, "Company Loss")

upComm.Parameters.Add("@IndLossProp", SqlDbType.Float, 4, "IndInsured Loss Prop")

upComm.Parameters.Add("@IndLossWC", SqlDbType.Float, 4, "IndInsured Loss WC")

upComm.Parameters.Add("@EventsInfo", SqlDbType.NVarChar, 255, "Event Info")

da.UpdateCommand = upComm

da.Update(dsAIR, "TextDB")



************* ANY HELP WOULD BE GREATLY APPRECIATED************

THANKS

View 3 Replies View Related

Dynamic String Manipulation

Sep 15, 2015

I have the following data in a table;

Create Table #Table (Column1 Varchar(1000))
INSERT INTO #Table
Select 'Execute Procedure @param1 = 100, @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param1 = 10, @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param1 = 100000, @param2 = 1000, @param3 = ''longtext'' '
Select * from #Table

I want to get rid of @Param1 in every row of the table so my final results look like this.

Create Table #FinalTable (Column1 Varchar(1000))
INSERT INTO #FinalTable
Select 'Execute Procedure @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param2 = 1000, @param3 = ''longtext'' '
Select * from #FinalTable

The tricky part is that the @param1 value length varies so a straight forward substring or replace function won't work.

View 1 Replies View Related

String Manipulation Question

Mar 31, 2008

Greetings all,

What's the neatest way to get the whole string but the last word?

e.g.

'THE CAT SAT ON THE MAT' would become 'THE CAT SAT ON THE'

My solution :


select left(@test, len(@test)-charindex(' ', reverse(@test)))


Thanks in advance.

View 1 Replies View Related

String Manipulation Challenge In SQL

Oct 27, 2005

I have a sql query in which I need to isolate part of the columm valueand return only that isolated portion. I can only do this within theselect statement, and cannot add a function or anything like that. Iwould also like to keep this query within sql (I don't want to do thisin my programming environment)The string value would normally look like "segment1-segment2-segment3".I need to isolate segment2, but I have to be able to account forsituations in which either one or both dashes are missing (in whichcase returning "" or the whole string is OK. The best I have been ableto do reliably is to get "segment2-segment3".Anybody want to take a stab?

View 4 Replies View Related

String Manipulation + Formatting

Dec 9, 2007

Is there anything in SSIS that enables simple string reformatting?

For example I'd like to convert the character string 1234567.89 to 1,234,567.89.

I used to do this with an edit pattern in Cobol, but I can't see anything in the Expressions editor....

View 4 Replies View Related

String Manipulation Within Stored Proc

Jan 21, 2005

Hi Guys,

I have an nVarChar field named "Event" (I know - I didn't name it !) with variable length values such as *ALARM* or *RESTORE*

They always start or end with a * and I want to trim them off before returning the data to my app.

I've got rid of the first one with...


LTRIM(STUFF(Event, 1, 1, ''))


Any tips on how to get rid of both of them in one go ?

Thanks in advance.

Steve.

View 2 Replies View Related

String Manipulation With Web Form Query

Feb 24, 2006

I'm trying to look up customer records by e-mail domain by using a text box on a Web form. So if I want to look for all my customers that have an aol e-mail domain, I would type aol.com in the text box and the sub routine would know to count 7 characters from the right and through those characters into maybe a parameter query. I'm having problems passing this in. I can count the characters properly by using:
dim strText = MyTextBox.Textdim intLength = strText.Length
but having problems starting here......
MyCommand.SelectCommand.Parameters("@email").Value = MyTextBox.Text
..............
but how would I ultimately feed this into my sql satement? Select * from Customers Where email = right(@email,intLength)
Help appreciated.
Frank
 
 

View 1 Replies View Related







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