473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Setting Defaults in an Insert Into command for SQL

Hi,

I have an issue where I am using INSERT INTO a Customer table with 36 fields- I have information for 2 fields and the

INSERT INTO [Customer](
[No_],[Name])
VALUES ('q1234','EP')

I get an error message..

Msg 515, Level 16, State 2, Line 2
Cannot insert the value NULL into column 'Search Name', table 'Customer'; column does not allow nulls. INSERT fails.
the statement has been terminated.


Is there a way to default the other fields to SPACE or something other than NULL - without defining every field.

Thanks
Nov 13 '07 #1
1 1102
iburyak
1,017 Expert 512MB
Try this:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [Customer]( 
  2. [No_],[Name],[Search Name])
  3. VALUES ('q1234','EP','') 
Or
you can set a default in table designer.

Good Luck.
Nov 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Samunderline | last post by:
Hello, Hi am trying to use the --defaults-file with a compiled version of mysql on a Feodra Core 2 based on Linux-2.6.5 I type the following command : /usr/local/mysql4src/libexec/mysqld ...
8
by: btober | last post by:
I'm finding that column defaults are not being assigned to nulls when I do an insert by way of a an ON INSERT rule on a view. For example, the following script \set ON_ERROR_STOP ON \c...
4
by: John Siracusa | last post by:
How can I create a non-null date column that defaults to 'now' as computed at the time the row is inserted? -John ---------------------------(end of broadcast)---------------------------...
0
by: Bill R via AccessMonster.com | last post by:
I have a procedure that runs when you dbl click in a txt box. It runs the docmd.acCmdHyperLink command. I am trying to find a way to have the "Insert Hyperlink" dialog box default to "Browse For"...
3
by: Barbara Lindsey | last post by:
I have a case where I am collecting a "Start Date" and an "End Date". I would like to default the "End Date" to the "Start Date" value if only the "Start Date" is entered. I tried setting this as...
6
by: axelsino | last post by:
I know this has been asked before and yes, I have read the section in the documentation about it. But, my question is: If I have setup mysql with strict_trans_tables, will MySQL allow "null"...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
5
by: rdemyan via AccessMonster.com | last post by:
I have a table with about 80 fields. I'm using an import process to populate the table. It works fine, except for the following: Users generally don't specify values for a lot of numerical...
12
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.