Can we save empty string into bigint column
SQL SERVER gives error when my bigint column has "" empty string any one have an idea please share
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Joginder BangerRank #360 · 7K reputationPosted Dec 21, 2014, 9:02 PM EST
i have create one table for you.
CREATE TABLE [dbo].[mytable](
[id] [int] NULL,
[testingone] [bigint] NOT NULL,
[testingtwo] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
and insert into value
alter proc mytb 11,'',56
@id int ,
@first varchar(max),
@second varchar(max)
as
begin
insert into mytable values(@id,@first,@second)
return
end
output is
select * from mytb
id testingone testingtwo
11 0 56
11 0 56
11 0 56
11 0 56
Danish HabibRank #2,024 · 715 reputationPosted Dec 21, 2014, 9:06 PM EST
Joginder BangerRank #360 · 7K reputationPosted Dec 21, 2014, 9:20 PM EST
pass a default parameters in table in design phase
Default value Or Binding ('')
Vikram AgrawalRank #4,713 · 329 reputationPosted Dec 21, 2014, 11:06 PM EST
You can also use IsNull() function at the time of inserting the data
like
Insert Into myTbl (Col1,Col2,.....)
Values
(IsNull(@value1,0),IsNull(@value2,0),....)
If the value have null then it will insert 0 instead of that otherwise it will insert you actual value.
Thanks.
Mark This Answer is Correct if it is helpful to you.