Invalid value for cell - sql-server-2008

I am trying to populate my table customers in Microsoft SQL Server Management Studio.
I am getting the following error. the
I am new to SQL and if anyone has encountered this type of error, would be grateful to share it.
Edit #1 Here are most of the tables

I also had this problem and it helped closing and reopening the solution, granted one has the correct datatype.

You use varbinary type for organisationname,and try insert value of string format "Microsoft".Change the datatype to varchar or insert in column binary data.

Related

SQL: String or binary data would be truncated

This worked in the very same manner last week. Today when I am trying to insert the data again, it gives me this silly error. Please help.
Check for a trigger (or perhaps default constraint?) which looks to be trying to populate the DW_LAST_MODIFIED_BY column with more than 25 characters.

How to build a database schema in sql fiddle?

I tried using the text dll but i'm getting this message"
Unable to find consistent column separator in header row
I viewed their sample file but its not clear how to create and insert values in the database
Is it k to copy our create code in text dll box...
can any one help me....
I have found that when getting data out of SQL server, if you have any kind of convert or cast functions in your select statement and don't specify a column name then this error is triggered when pasting data into SQL fiddle text to DDL. (No column name) will show up unless you alias your column name after the convert/cast by using:
AS 'Your Column Name'
Example:
CONVERT(date, Dt_Approv) AS Dt_Approv
This gets rid of the (No column name) in the DDL that causes the error. It is at least something to try, it worked for me.
EDIT:
Not sure if I answered you the way you were hoping. To use the text to DDL tool on SQL Fiddle, all you have to do is paste in the tabular data from your databse or spreadsheet. From that the program will build the DDL, hence text to DDL :)
No need for create or insert statements when using text to DDL, it will write them for you.

url is not being inserted in database correctly

I am trying to insert
http://www.urbandictionary.com/define.php?term=plagerism
in mysql database. The data type is varchar(500).
But what i get in the field is
http://www.urbandictionary.com/define.php%3Fterm%3Dplagerism
Can anyone help me explain how i can fix this.
Thanks
look at PHP's URLencode() and URLdecode() http://php.net/manual/en/function.urlencode.php
what is the code you use for inserting into database?
I would guess there is a part that reqrites part of the data to prevent SQL Injection...

Using SSIS, how do you read a datetime field into a variable that is of Data Type string?

This one has bugged me for the longest time and a great question to ask the Stackoverflow users I think.
I have a rather large SSIS flow that uses a string variable to store the datetime. I would now like to dynamically read the datetime value from the database, but how would you construct the SSIS to do this?
My first obvious thought would be to simply execute a SQL task to get the datetime and store it in the variable, but got the "differs from the current variable type" error.
Is there a simple way to convert the database datetime into a String variable?
Any help from the community would be appreciated,
Sure you use a derived column and convert the data from the datbase column to one of the correct type.
Another method would be to use t-sql code as your data source and do the cast inthe t-sql code so that the field comes into the dataflow as string.
Or of course you could change the string to a date type.

When saving to a model, created and modified aren't automatically populated by CakePHP. Using SQL Server

Hi when saving to a model, my created and modified fields aren't automatically populated by CakePHP. It was automatically populated when I was using MySQL but now it isn't. I'm not using NOW() back when I was still using MySQL. Why is it? Also when a field's value is not set 'NULL' (with quotes) is inserted causing errors because SQL Server says I can't insert a string to a field of type smallint/date etc. How do I fix this?
Thanks in advance!
I would set NULL as a keyword rather than quoting it, which I imagine is why your database thinks that it's a string.
Have you double checked the schema of the database to ensure that the created and modified fields are still DATETIME fields.
Also you say "SQL Server", and mention MySQL, so I assume that you are now using MSSQL?