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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vikram AgrawalPosted Dec 22, 2014, 4:06 AM
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.
Joginder BangerPosted Dec 22, 2014, 2:20 AM
pass a default parameters in table in design phase
Default value Or Binding ('')
Danish HabibPosted Dec 22, 2014, 2:06 AM
Joginder BangerPosted Dec 22, 2014, 2:02 AM
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