Showing posts with label datatype. Show all posts
Showing posts with label datatype. Show all posts

Tuesday, March 27, 2012

Difference between max length and length in DataType Schema

Using OleDb I can retrieve the Database Native DataTypes Schema with LoadSchema("DataTypes")

In the CreateParameters column some variable fields such as varchar have CreateParametera of 'max length' while nchar has a CreateParameters of 'length'.

Can someone differentiate between 'length' and 'max length' for me?

TVM

BOL: "nchar [ ( n ) ]

Fixed-length Unicode character data of n characters. n must be a value from 1 through 4,000. The storage size is two times n bytes. The SQL-2003 synonyms for nchar are national char and national character.

varchar [ ( n | max ) ]

Variable-length, non-Unicode character data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of data entered + 2 bytes. The data entered can be 0 characters in length. The SQL-2003 synonyms for varchar are char varying or character varying."

so max length for nchar is 4,000.

for varchar(max) max length is 2^31-1 bytes depending on platform.

Thanks.

Sunday, March 25, 2012

Difference between Flat File Source Output ?

Can someone tell me the difference between the Flat File Source Output - External Columns and Output Columns ?

I always end up changing the datatype properities in both to make things work :-)

? Hi, Have you tried setting the datatypes for the external columns using the Advanced pane of the Flat File Connection Manager? What you set there ought to be carried through to the Output columns. Andrew Watt [MVP] <cgpl@.discussions.microsoft..com> wrote in message news:760e2f6b-3480-4430-850e-8b30237e462d@.discussions.microsoft.com... Can someone tell me the difference between the Flat File Source Output - External Columns and Output Columns ? I always end up changing the datatype properities in both to make things work :-)|||

By definition, output columns represent the column schema of the component itself. External columns represent the column schema of the database that the component is connected to.

Try editing the column defs in the connection manager and see if that eases the experience.

Difference between dataTypes in SQL 2005?

What is the difference between binary and image dataType.

When and how should I use them?Hello,

Here is difference between binary and image data type.
BINARY: Fixed-length binary data with a maximum length of 8,000 bytes
IMAGE: Variable-length binary data with a maximum length of 2^31 - 1 bytes

You can use them accordingly...