I have a table in which phno is one of the columns.i do have
some values in tht phno column.i need to update phno column
values with 0(zero) as prefix.give me a correct solution plz...
Answers were Sorted based on User's Feedback
Answer / anand k
Hi,
Yoy didn't mention the datatype of the column "phone
number"
prob the varchar datatype has used to the phno.
update <tablename>
set phno = cast(0 as varchar(1)) + phno
Is This Answer Correct ? | 16 Yes | 1 No |
Answer / rajshekar
update <tablename>
set phno=cast (0 as datatype(1))+phno
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / khalid moin
update <tablename>
set <column name>='0'||<coulmn name>;
this query will update the values present in column with
prefix 'o'
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / a
update <table_name> set phno = Convert(int, '0' +
Convert(varchar(10),phno))
Is This Answer Correct ? | 1 Yes | 3 No |
What is abstracting periodical?
If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security
how can a database be repaired? : Sql server administration
What is the temp table?
Is mysql better than sql server?
How to convert binary strings into integers in ms sql server?
How to enter unicode character string literals in ms sql server?
Is it ok to shrink transaction log?
Explain having clause?
Write a query for primary key constraint with identity key word?
what is the difference between group and having give an example with query and sample output
Restore database SQL2000, SQL2012 Backup of base is created in Microsoft SQL Server 2000 - 8.00.2066, I can't restore on Microsoft SQL Server 2012 - 11.0.2100.60