how we can store the value like that 001,003,023 etc in sql
server 2005

Answers were Sorted based on User's Feedback



how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / gopi muluka

Using Character Datatypes
See this
CREATE TABLE NumAsVar (Num VARCHAR(50))
INSERT INTO NumAsVar VALUES ('001')
INSERT INTO NumAsVar VALUES ('002')
INSERT INTO NumAsVar VALUES ('021')

SELECT * FROM NumAsVar

Is This Answer Correct ?    12 Yes 5 No

how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / mohammad saddam

CREATE TABLE NumAsVar (Num nvarchar(50))
INSERT INTO NumAsVar VALUES ('001')
INSERT INTO NumAsVar VALUES ('002')
INSERT INTO NumAsVar VALUES ('021')

Is This Answer Correct ?    5 Yes 1 No

how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / laxman r

UPDATE [APPPARAM] SET [APPPARAM_VALUE] = Replicate('0', 3 -
Len(convert(varchar, (@DATABASE_IDENTITY_NO + 1)))) +
convert(varchar, (@DATABASE_IDENTITY_NO + 1)) FROM
[APPPARAM] a WHERE a.[APPPARAM_KEY] = @AppParamKey

Is This Answer Correct ?    3 Yes 2 No

how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / sandeep modapathi

replicate('0',3-len(field_name))+field_name

Is This Answer Correct ?    0 Yes 1 No

how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / achuthan

set @s= ''
select @s=@s+column +','
if Len(@s)>0
select @s = substring(@s,1,len(@s)-1)

Is This Answer Correct ?    0 Yes 6 No

how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / nadeem

create table t(NUM int(22))
insert into t values(001)
insert into t values(002)
insert into t values(023)

Is This Answer Correct ?    1 Yes 9 No

how we can store the value like that 001,003,023 etc in sql server 2005..

Answer / sathish kondaveeti

create table value(num int(3))
insert into value values(001)
insert into value values(003)
insert into value values(023)

to see this table
select * from value

Is This Answer Correct ?    0 Yes 10 No

Post New Answer

More SQL Server Interview Questions

UPDATE statement can on a single table or on the multiple table?

7 Answers   iGate, TCS,


Can you explain about buffer cash and log cache in sql server?

0 Answers  


How do you fine the performance tunning?

2 Answers   Accenture,


Lets say due to N/W or Security issues client is not able to connect to server or vice versa. How do you troubleshoot?

1 Answers  


Explain different isolation levels?

4 Answers  






I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

0 Answers   IBM,


What are the joins in sql server? : sql server database administration

0 Answers  


How do I debug a stored procedure in sql server?

0 Answers  


What are the disadvantages of using the stored procedures?

0 Answers  


How many .ndf files can we create in Sql server 2005?

2 Answers   Wipro,


can you any body tell me the how to decrease the logfile

4 Answers  


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

0 Answers  


Categories