Showing posts with label receives. Show all posts
Showing posts with label receives. Show all posts

Monday, March 19, 2012

An interesting holistic question for the groupmind...

Ok,

I work for an organization which receives numerous contracts from
numerous clients. Now, with each new contract comes new flatfiles
needing importing (with differing formats and fields, etc...), faulty
data, etc... It's not as easy as just telling all the contractors "ok,
we now need all the data you send us in a generic universal format" as
many of the contractors have contracts dating back years, and they only
provide what their contract specifies they provide, nothing more. Also,
it's not as easy as saying "get on board with this new format or the
contract is cancelled" as many of the contracts carry steep
cancellation fees and/or actually breaking the relationship is just not
feasible, given the services some provide.

So basically, does anyone out there have experience with constructing a
flexible method of dealing with routine introduction of new data
formats, and a constant barrage of change?
Any tips, links, or books you can recommend? Thanks!Have you looked at any third-party ETL tools? There are a lot of products
that exist to meet this kind of requirement. Here are a few of the leading
vendors.

http://www.pervasive.com
http://www.datawatch.com
http://www.ascential.com
http://www.informatica.com
http://www.embarcadero.com
http://www.datamirror.com

--
David Portas
SQL Server MVP
--

Thursday, February 9, 2012

Alternative for LEFT() and CHARINDEX() that works with text Data Type

I have a stored procedure that receives a list of ids, to get the emails of each of those ids. The problem that I'm having is that I'm using a char data type that is max length is 8000, but the contact lists are getting bigger and soon they might reach the variable max length. The contact list that I receive will look something like this "1234,67523,67875,789687,", I'm using "," as a separator. Right now what I do is this

@.array_value=LEFT(@.ContactList, @.separator_position- 1)

The LEFT function doesn't work with data types text and ntext. But I'm in need of a string data type with a max length bigger than 8000. So I will apreciate if anyone knows of another function that does the same or similar and works with text data type, or any other ideas will be welcome.

Thanks,

Erick

what database & version are you using?

|||

SQL Server 2005

|||

Use varchar(max) instead of varchar(8000) then.

|||

Can you change the datatype? Try using varchar(MAX) or nvarchar(MAX). MSDN says built-in string functions have been built to work with the new large object types (MAX).

http://msdn2.microsoft.com/en-us/library/ms178158.aspx

|||

I just changed, I didn't know that worked. I just read thats new in sql 2005, that didn't work on 2000.

Thanks

|||

That worked but, Can I give max value to varchar in asp.net vb?

|||

http://msdn2.microsoft.com/en-us/library/a1904w6t(VS.80).aspx

|||

It looks like you just set the type to the normal DBType, i.e. use varchar for varchar(MAX), then set the length to -1 (this tells the parameter to use whatever length the data is, rather than specifying how much of the data to use).