Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mukhan85
Starting Member
46 Posts |
Posted - 2011-09-25 : 08:49:25
|
Hi, I'm trying to insert a record into the table with the following schema: Column_name DataType Keywkflw_activity_id numeric Trueactivity_name varchar Falsewkflw_item_id numeric Falseresp_party varchar Falseassigned_to varchar Falseaction varchar Falsecomments varchar Falseparent_activity_id numeric Falsewkflw_name varchar Falsestart_date datetime Falseend_date datetime Falsedue_date datetime Falsecreated_by varchar Falsecreated_time datetime Falsemodified_by varchar Falsemodified_time datetime Falsewkflw_version varchar False Query: INSERT INTO tableName(activity_name, wkflw_item_id, action, comments, parent_activity_id, wkflw_name, start_date, end_date, due_date, created_by, created_time, modified_by, modified_time)VALUES('New', 313396, NULL, NULL, 0, 'controls', '20110927 13:33:32.0', NULL, NULL, 'maks', '20110927 13:43:33.0', 'john', '20110927 13:33:32.0')GOError Implicit conversion from datatype 'NUMERIC' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query.The column wkflw_activity_id should be automatically generated.Any suggestions? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-25 : 13:04:34
|
| if you want to generate wkflw_activity_id automatically, make it identity type and of integer type rather than numeric------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
paultech
Yak Posting Veteran
79 Posts |
Posted - 2011-09-27 : 09:54:04
|
| May I suggest if you don't want it to be automatically generated, you can set a default value for it |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-27 : 11:34:00
|
quote: Originally posted by paultech May I suggest if you don't want it to be automatically generated, you can set a default value for itpaul Tech
how will you make sure its in sequence?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|