Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Monday, March 26, 2012

noobie question on CSV Flat Files

Hi there,

I am connecting to a CSV file. When I look at the raw CSV, most of rows look something like this:

"19056","CD","Rick James"
These rows work fine but I run it to trouble when some rows look like this in the raw form:

"134530","Poster","Elizabeth on the set of "Giant", 1955"

You can see the issue that will arrise, SSIS parses this as 4 columns. Note: In the "Flat File Connection Manager" I have the "text qualifier" set to ".

Any suggestions as to how I might process files that have this type of situation? Maybe some sort of pre-process is necessary?

Other than that I've had great success with the other components and I am enjoying SSIS very much, great product!

Flat File Source does not support Embedded Qualifiers. Parsing columns that contain data with text qualifiers will fail at run time.You can use the Flat File Source to load the data as unqualified data and use a script component later to strip off the qualifiers downstream. You can also write a custom component to do the same. There is an Undouble component available for download from

http://www.microsoft.com/downloads/details.aspx?FamilyID=B51463E9-2907-4B82-A353-E15016486E1D&displaylang=en

which you can use.

|||

Thanks Ranjeeta,

This is kind of what I figured would be the case. I'll ask the publisher of the CSV to perhaps rethink their practice of embedded qualifiers. If I have no luck with that, I'll have to do something similar to what you're describing. Thanks for the link!

noob to SSIS package configure and deploy

Hi there

I am fairly new to SSIS, I got my package running fine in my development environment with the connection managers (connecting to 3 databases on the same server, with username and password, not Integrated security) and all.

The problem comes in when i want to deploy my package or execute it outside of the development environment.

When I execute the .dtsx file in my project it brings up the Execute Package Utility and I just click Execute, thinking it should work, but not, any ideas?

So I read some of the forums and got looking into the configuration file, suppose that it does not carry the connection manager settings thru, but dam that still doesn't work for me?

The whole idea is that I will be executing the package from my C# code, so does my package have to be just on the server in a folder or does it have to be installed in the db? which is best?

Hope anyone can help me!!

Thanks
Jamie

If the error you are getting is a failure to connect to the database, the problem is in the password not being stored in the package. If you search the forum for connection strings and configurations, you'll see a number of different solutions to this.

If that's not the problem, please include the error message that you are receiving.

Monday, March 12, 2012

Non Windows App connecting to SQL Server using Windows Auth

How can a non Windows App , say an app that runs on Linux connect to SQL
Server using Windows Auth ?
Has anyone done that ? How does Linux integrate with Windows ? Are there 3rd
party tools ?
We know SQL Auth would work but we want to use Windows Auth only.
Please let me know
ThanksTypically a Linux box uses something like FreeTDS to connect to a SQL
Server machine. FreeTDS supports both forms of authentication:
http://www.freetds.org/faq.html

Non Windows App connecting to SQL Server using Windows Auth

How can a non Windows App , say an app that runs on Linux connect to SQL
Server using Windows Auth ?
Has anyone done that ? How does Linux integrate with Windows ? Are there 3rd
party tools ?
We know SQL Auth would work but we want to use Windows Auth only.
Please let me know
ThanksTypically a Linux box uses something like FreeTDS to connect to a SQL
Server machine. FreeTDS supports both forms of authentication:
http://www.freetds.org/faq.html

Saturday, February 25, 2012

No value given for one or more required parameters.

HI everyone, pls can u tell me whats the error in my code?

I am connecting to an oledb database

sql_edit_record = "UPDATE Anamnese SET ";

sql_edit_record += "ID=?,";

sql_edit_record += "Sexe = ?,";

sql_edit_record += "[Date de Naissance] = ?,";

sql_edit_record += "Classe = ?,";

sql_edit_record += "Ecole = ?,";

sql_edit_record += "Adresse = ?,";

sql_edit_record += "Telphone = ?,";

sql_edit_record += "[Cot de signalement] = ?,";

sql_edit_record += "[Motif de consultation] = ?,";

sql_edit_record += "[Histoire familale] = ?,";

sql_edit_record += "[Histoire mdicale] = ?,";

sql_edit_record += "[Histoire dveloppementale] = ?,";

sql_edit_record += "[Histoire scolaire] = ?,";

sql_edit_record += "[Situation socio-conomique] = ?,";

sql_edit_record += "[Histoire comportementale] = ?";

sql_edit_record += "WHERE Nom = ?";

//sql_edit_record = "UPDATE Anamnese SET Sexe = 'M' WHERE Nom = 'Dory'";

db_adapter.UpdateCommand.Connection = oledb_connection;

db_adapter.UpdateCommand.CommandText = sql_edit_record;

using (db_adapter.UpdateCommand)

{

textBox1.Text = sql_edit_record;

db_adapter.InsertCommand.Parameters.Add("@.ID", OleDbType.VarChar).Value = current_row.ToString();

db_adapter.InsertCommand.Parameters.Add("@.SEXE", OleDbType.VarChar).Value = sexe;

db_adapter.UpdateCommand.Parameters.Add("@.DATEDENAISSANCE", OleDbType.VarChar).Value = date_de_naissance;

db_adapter.UpdateCommand.Parameters.Add("@.CLASSE", OleDbType.VarChar).Value = classe;

db_adapter.UpdateCommand.Parameters.Add("@.ECOLE", OleDbType.VarChar).Value = ecole;

db_adapter.UpdateCommand.Parameters.Add("@.ADRESSE", OleDbType.VarChar).Value = adresse;

db_adapter.UpdateCommand.Parameters.Add("@.TELEPHONE", OleDbType.VarChar).Value = telephone;

db_adapter.UpdateCommand.Parameters.Add("@.SIGNALEMENT", OleDbType.VarChar).Value = signalement;

db_adapter.UpdateCommand.Parameters.Add("@.MOTIF", OleDbType.VarChar).Value = consultation;

db_adapter.UpdateCommand.Parameters.Add("@.HIS_FAM", OleDbType.VarChar).Value = his_familiale;

db_adapter.UpdateCommand.Parameters.Add("@.HIS_MED", OleDbType.VarChar).Value = his_medicale;

db_adapter.UpdateCommand.Parameters.Add("@.HIS_DEV", OleDbType.VarChar).Value = his_developpementale;

db_adapter.UpdateCommand.Parameters.Add("@.HIS_SCOL", OleDbType.VarChar).Value = his_scolaire;

db_adapter.UpdateCommand.Parameters.Add("@.HIS_SOCIO_ECO", OleDbType.VarChar).Value = his_socio_eco;

db_adapter.UpdateCommand.Parameters.Add("@.HIS_COMPORTEMENTALE", OleDbType.VarChar).Value = his_comportementale;

db_adapter.UpdateCommand.Parameters.Add("@.NOM", OleDbType.VarChar).Value =cbox_name.Text;

db_adapter.UpdateCommand.Connection.Open();

db_adapter.UpdateCommand.ExecuteNonQuery();

db_adapter.UpdateCommand.Connection.Close();

}

Without seeing any error messages it's hard to tell, however the first thing that stands out is the following:

sql_edit_record += "[Histoire comportementale] = ?";

sql_edit_record += "WHERE Nom = ?";

You should insert a space after the question mark on the first line, like so:

sql_edit_record += "[Histoire comportementale] = ? ";

sql_edit_record += "WHERE Nom = ?";

You may also find that you have to wrap the placeholders in single quotes where your table columns are of a textual datatype, for instance:

sql_edit_record += "[Histoire comportementale] = '?' ";

sql_edit_record += "WHERE Nom = '?'";

Is there a reason that you aren't using stored procedures to perform this task?

Chris

|||

Thanks for ur reply, the error is :

OleDBException was Unhandled

No value given for one or more required parameters.

Allthough I put the space after the ?.

|||

Sorry to state the obvious, but could the problem be that you haven't assigned values to all of the parameters?

Thanks
Chris

|||

Would an empty string("") raise such an error?