Im dumping data from a PostgreSql DB into SQL Server. After cleaning up the generated SQL I created my table as such:
<code>
CREATE TABLE certifications (
cert_id int identity(1,1),
seminar_date datetime NOT NULL,
last_name varchar NOT NULL,
first_name varchar NOT NULL,
housing_agency varchar NOT NULL,
seminar varchar NOT NULL,
UNIQUE (cert_id)
);
</code>
When I try to insert like so:
<code>
Set identity_insert certifications on
Go
INSERT INTO certifications (cert_id, seminar_date, last_name, first_name, housing_agency, seminar) VALUES(580, '2001-03-23', 'Dean', 'James', 'Some Finance Agency', Some Certification');
INSERT INTO certifications (cert_id, seminar_date, last_name, first_name, housing_agency, seminar) VALUES(580, '2001-03-23', 'Dean2', 'James2', 'Some Finance Agency2', Some Certification2');
Set identity_insert certifications off
Go
</code>
(There are a few thousand records)
I get this error:
<error>
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
</error>
Any help would be greatly appreciated
TIACREATE TABLE certifications (
cert_id int identity(1,1),
seminar_date datetime NOT NULL,
last_name varchar NOT NULL,
first_name varchar NOT NULL,
housing_agency varchar NOT NULL,
seminar varchar NOT NULL,
UNIQUE (cert_id)
);
You will need to specify the width of varchar colums .. i believe that is the source of your problem|||You were correct. Thanks a bunch! -Esql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment