July 15, 2013 at 2:47 am
select isnull(id,0)+1 as ID from TABLE1
i have the id field blank with defualt value as 0
but when i use the abobe query i dont get 1
select isnull(id,0) as ID from TABLE1 i dont get 0
July 15, 2013 at 2:57 am
What's your question?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
July 15, 2013 at 3:04 am
i have a int column as Custid
initally value is balnk.
but i have set the default value when creating the field as 0
i need to increment the max Custid value
but if its null i need it be 0 so incrementing it would be 1
select isnull(Custid,0)+1 as ID from TABLE1
i have the Custid field blank with defualt value as 0
but when i use the abobe query i dont get 1
select isnull(Custid,0) as ID from TABLE1 i dont get 0
July 15, 2013 at 3:11 am
ssurekha2000 (7/15/2013)
i have a int column as Custidinitally value is balnk.
but i have set the default value when creating the field as 0
i need to increment the max Custid value
but if its null i need it be 0 so incrementing it would be 1
select isnull(Custid,0)+1 as ID from TABLE1
i have the Custid field blank with defualt value as 0
but when i use the abobe query i dont get 1
select isnull(Custid,0) as ID from TABLE1 i dont get 0
Can you provide DDL and sample data so that I can see what your source data looks like? See the link in my signature for details of how to do this.
Note that there is (potentially) a difference between 'NULL' and 'blank'.
And still you have not asked a question.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
July 15, 2013 at 3:20 am
solved
July 15, 2013 at 3:25 am
ssurekha2000 (7/15/2013)
CREATE TABLE [dbo].[DETAILS]([ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[CLENO] [int] NOT NULL CONSTRAINT [DF_DETAILS_CLENO] DEFAULT ((0)),
[Custid] [int] NOT NULL CONSTRAINT [DF_DETAILS_Custid] DEFAULT ((0)),
CONSTRAINT [PK_DETAILS] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
Still no sample data and no questions ... I'm out.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
July 15, 2013 at 3:29 am
if solved please post ur solution surekha..
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply