Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

0 Answers  


What is difference between restoration and recovery in SQLServer?

3 Answers   Microsoft,


How to end a stored procedure properly in ms sql server?

0 Answers  


How to skip remaining statements in a loop block using continue statements?

0 Answers  


How to enter date and time literals in ms sql server?

0 Answers  


Describe how to use linked server?

0 Answers  


what changed between the previous version of sql server and the current version? : Sql server database administration

0 Answers  


How to check if a table is being used in sql server?

0 Answers  


What is the preferred way to create a clustered and non-clustered index? Which index should you create first the clustered or non-clustered?

0 Answers  


Why should one not prefix user stored procedures with ‘sp_’?

0 Answers  


How to handle errors in Stored Procedures. I want to display a message to the user in the .aspx page that is calling a stored procedure in it's code behind. please help me.

2 Answers   247Customer,


What keyword you will use to get schema appended to the result set of a ‘for xml’ query?

0 Answers  


Categories