Field Size using SSIS - sql

I'm immporting a csv file with column headers:
ID ProductNumber ProductName
1234 A298384 Whatchamacallit
3949 A293939 Whatchamacallit_Extra
I only need the ID and ProductNumber, when I map the file, I set ProductName to 'ignore'
When the package runs, it errors with the mesage that ProductName will truncate. I don't
understand why its erroring if I set the mapping to 'ignor'
I've also tried to import and have included ProductName, setting the field to Nvarchar (4000), it still errors. I've checked the file, there is no product name more than 54 characters.
I'm using SQL 2005.
Any insight would be helpful
Thanks.

I assume you have some kind of "Flat File Source" as the source connection for your data flow. If so, when you click into it and view columns; is the Productname unchecked?

If you don't want to import the third column, go to advanced tab in your connection manager and delete the last row.
Another way would be to ignore the errors occuring in the error output tab in your flat file task (ingore truncation and failure), but i advice you to use what i wrote above.

Another way to fix this is to go into the Advanced section of the flat file connection manager and set the field length for the last field to something higher than the default 50 that is set for string values if you don't override. Since you say that 54 is your longest data width for that last column use at least that value.
To find where to change this, open the connection manager editor by double clicking the flat file connection. In the box on the left there are four choices "General", "Columns", "Advanced", and "Preview". You will want to click Advanced, then highlight your "ProductName" column, then in the box on the right find "OutputColumnWidth" and set it to at least 54.

Related

UniQuery LIST without page breaks

This should be simple but it's just not working. I have a list of records that I want to display in the terminal without anything besides the list of record keys. No Headers, page gaps, etc. The problem is I can't get rid of the page gaps that keep chopping up my list.
SORT INVENTORY HDR.SUPP COL.HDR.SUPP NO.PAGE NO.SPLIT COUNT.SUP
You need to change your TERM settings, ignore the 'type' option.
Increase the TERM 'B' (HELP TERM) to the total number of records you are returning.
For example if the report contains 100 records, you enter:
: TERM [to get default settings]
: TERM 80,100,132,60
: run LIST/SORT
: TERM A,B,C,D [ use values from first TERM ]
You need to run the term command prior to running your select.
Just in case you're trying to get this list of bare keys so you can copy/paste it somewhere else (like Excel), I'll throw out another option that may be helpful and save some scrolling:
:sort INVENTORY TO DELIM 9 /tmp/inventory.txt
Will run your command and dump the output (tab-delimited, though that's irrelevant with only one field) to a file in the tmp directory.
:UDT.OPTIONS 91 ON
Is helpful if you're dumping dates, numbers or anything that needs output formatting.
UDT Options Command reference describes that:
UDT.OPTIONS 91 U_LIST_TO_CONV
affects saved queries on
data that is defined in the dictionary with a conversion code. For
example, when a date is defined as D4, the internal date is 9611,
which the conversion code translates as 04/24/94. UniData does not
convert the data before it saves UniQuery results to an ASCII file.
With UDT.OPTIONS 91, you can force the conversion before UniData saves
the ASCII file.

SMSS: text qualifier in the Tasks > Data Import?

I am trying to import a file, source here and selections here (select all fields and select "Pilkkueroteltu (otsikollinen)" and then click Jatka to download), with two header rows, " as text qualifier, comma as a field separator and with UTF-8 format. I am unable to do this in Micsosoft Server SQL Management Studio. I will focus now only on the text qualifier where " does not work (only reading the first quote as text qualifier).
where I am unable to specify the column separator, no idea why this is occurring.
Update 1
Refresh/Reset buttons fixed the initial preview but I am getting the following preview error in the step Select Source Tables and Views later.
Update 2
I get the LocaleID error The LocaleID 11 is not installed on this system.
(SQL Server Import and Export Wizard). I am getting the same error despite Locale/Code page settings, what is causing this?
How to specify the text qualifier in the MSMM?
I tried to replicate your scene. Very first, I had to delete first heading entry eg : "Kuntien avainluvut 1987-2016"
Please see : sample image
Column delimited is: ,
Might not be accurate answer or different from something which you expect, but by applying above settings, I could import data through SSMS2012
edit : based on comments.
Here is the detailed steps :
next,
next, you need to change column width of first column as it gave me data truncate error
next,
I have also got a dtsx package for the same, but I don't know how can I share it with you here.

Intellij/AppCode increase selected number value

In Intellij/Appcode, is there any option or plugin I can use so that when I press a certain key(e.g. up arrow) it will increase the selected value by 1 like web developer tool?
String Manipulation plugin may be what you are looking for, it has the following feature:
Increment/Decrement selected text. Duplicate line and increment/decrement all numbers found. (Does not work in column mode)
There is also a related feature request.

Find correct table number (Selenium IDE)

I have this command here in Selenium IDE to store a text in a variable:
Command: storeText
Target: //div[#id='content-main']/form[2]/table[5]/tbody/tr[td[1][contains(text(), 'Purchase')]]/td[2]
Value: variableName
As you can see, in this command it looks in the first column of the 5th table and search for the line where it says "Purchase" and stores the string content from the second column.
The problem is this: table[5]
There are some times where this table is not always the 5th table. So, I'd like to know if there is some way to search for this String that I'm looking for, but without the table number, so the command would first find the table number, and then find the string I'm looking for.
To make it easier, here is the HTML source of the page I'm doing my tests:
http://txtup.co/e9KYB
I accept suggestions to maybe do it in another way, what I need is to store the Purchase Type value that is in this page.
Just change table[5] to table. The full XPath will then be:
//div[#id='content-main']/form[2]/table/tbody/tr[td[1][contains(text(), 'Purchase')]]/td[2]

Can the user be forced to enter a non-initial value by the Table Maintenance screen in SM30?

I'd like to force the user to chose between Yes and No, and not let him add an entry where the value is initial.
This is regardless of whether I check the Initial checkbox in the table definition.
Can this be done?
Domain data type : CHAR, 1 character, no conversion routine.
Value range: single values:
'1' description = 'Yes'
'2' description = 'No'
By far the easiest way is to use a data element in the table that only allows non-initial values.
If you can't change the data element, you can try using table maintenance events in the table maintenance generator:
You may be able to use event 1 (Before save) or event 5 to build a manual check, but 5 does not kick off on change.
If that doesn't work, you can still manually add a check in the PAI of the screen, however you run the risk that if someone regenerates the maintenance scree, they will forget/not know to put the check back in.
You can set the compare flag:
But from what I've seen the flag doesn't actually force you to redo any of the changes, and is still pretty easy to miss.
You can edit the screen and set the field to mandatory. Be aware that you will loose the change if the screen is re-generated.
You can do that with that steps:
in SE11 choose the Utilities menu -> Table Maintenance Generator
in the Table Maintenance Generator go to menu Environment -> Modification -> Maintenance Screens, then select the screen (usually is 0001), in the Element List Tab you find the Special attr, in the field Input, you choose Required for the field you want obligatory.
Thanks.
Regards.
Gil Mota.