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 are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008
What is merge join?
What are the different normalization forms?
What is the sql case statement used for?
How make remote connection in database?
Explain differentiate between a having clause and a where clause?
How to rename an existing table with the "sp_rename" stored procedure in ms sql server?
Can foreign key be deleted?
Define the one-to-one relationship while designing tables.
How can I create a table from another table without copying any values from the old table?
What is implicit cursors?
What happens if strings are casted into wrong code pages in ms sql server?