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 |
Explain the benefits of user-defined functions?
Define the term DML, DDL and DTL?
Can we use where and having clause together?
Why are views required in the sql server or in any other database?
What is the recursive stored procedure in sql server?
What are the benefits of filtered indexes?
What are a database and a data warehouse?
How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?
Do you know what is xpath?
what is the system function to get current user's user id? : Sql server database administration
What is a transact-sql statement?
What is db stored procedure?