I need to insert a null value in a table on MS SQL Server 2000 using a stored
procedure.
When I send no data to the stored procedure, I get an error saying that the
value cannot be null, but I did the table to receive null values.
I tried DBNull.Value but didn't work.
Thanks, Rodrigo. 3 7296
Do you have access to the Stored Procedure Code? Set a default value of
NULL on the Stored Procedure parameter; then when you want NULL inserted,
just don't pass that parameter to your SP. It will default to NULL and all
should be good.
"Rodrigo C. Souza" <Rodrigo C. So***@discussions.microsoft.com> wrote in
message news:F3**********************************@microsof t.com... I need to insert a null value in a table on MS SQL Server 2000 using a stored procedure. When I send no data to the stored procedure, I get an error saying that the value cannot be null, but I did the table to receive null values. I tried DBNull.Value but didn't work. Thanks, Rodrigo.
Hi,
Why don't you try to run the query from Query Analizer and see what gives.
If still havin gproblem just post the code , the SP and the table definition
:)
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Rodrigo C. Souza" <Rodrigo C. So***@discussions.microsoft.com> wrote in
message news:F3**********************************@microsof t.com... I need to insert a null value in a table on MS SQL Server 2000 using a stored procedure. When I send no data to the stored procedure, I get an error saying that the value cannot be null, but I did the table to receive null values. I tried DBNull.Value but didn't work. Thanks, Rodrigo.
If you set the property "IsNullable" on your SqlParameter object to
true, then you should be fine.
Example:
SqlParameter myParam = new SqlParameter
( "@Description"
, sqlDataType.VarChar
);
myParam.IsNullable = true; This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: soni29 |
last post by:
hi,
i have a small question regarding sql, there are two tables that i
need to work with on this, one has fields like:
Table1:
(id, name, street, city, zip, phone, fax, etc...) about 20 more...
|
by: brent.ryan |
last post by:
How do I get the next int value for a column before I do an insert in
MY SQL Server 2000? I'm currently using Oracle sequence and doing
something like:
select seq.nextval from dual;
Then I...
|
by: serge |
last post by:
I have a scenario where two tables are in a One-to-Many relationship
and I need to move the data from the Many table to the One table so
that it becomes a One-to-One relationship.
I need to...
|
by: Magnus Byne |
last post by:
Hi,
I have a problem using serializable transactions. In one transaction I
select a single specific row from a table using a where clause (this
causes it to acquire and hold a range lock). In...
|
by: V T |
last post by:
Hello all,
SQL Server 2000 documentation
http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part10/c3761.mspx
states that if view is using "NOT NULL" columns of a base table, then...
|
by: rn5a |
last post by:
During registration, users are supposed to enter the following
details: First Name, Last Name, EMail, UserName, Password, Confirm
Password, Address, City, State, Country, Zip & Phone Number. I am...
|
by: iKiLL |
last post by:
Hi all
I am having problems getting my SqlCeDataAdapter to Update the SQL Mobile
Data base.
i am using C# CF2.
I have tried this a number of different ways. Starting with the command
builder...
|
by: teddysnips |
last post by:
I have an application that does some data manipulation of some tables
to format a table for a report.
1. First I open the table that gives me the parameters for some later
queries
strSQL =...
|
by: EJO |
last post by:
with sql 2000 enterprise
Trying to build a stored procedure that will take the rows of a parent
table, insert them into another table as well as the rows from a child
table to insert into...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |