how we can store the value like that 001,003,023 etc in sql
server 2005
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / sandeep modapathi
replicate('0',3-len(field_name))+field_name
Is This Answer Correct ? | 0 Yes | 1 No |
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 |
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 |
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 |
UPDATE statement can on a single table or on the multiple table?
Can you explain about buffer cash and log cache in sql server?
How do you fine the performance tunning?
Lets say due to N/W or Security issues client is not able to connect to server or vice versa. How do you troubleshoot?
Explain different isolation levels?
I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?
What are the joins in sql server? : sql server database administration
How do I debug a stored procedure in sql server?
What are the disadvantages of using the stored procedures?
How many .ndf files can we create in Sql server 2005?
can you any body tell me the how to decrease the logfile
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 ?