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 |
Give an example of SQL injection attack ?
How to delete duplicate records based on single column from a table?
0 Answers Petranics Solutions,
How many types of Cursor in SQL SERVER?
Can we store videos inside the sql server table?
explain different types of jions with examples briefly?
2 Answers Accenture, Excellence, Zensar,
How to make a remote connection in a database?
How do I create a partition table in sql server?
create index a on employee(dno) In this,which index was created?
What is reference section?
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
What are temporal tables in sql server 2016?
When we are using this query to shrink the log file,what exactly it will execute internally? Do we lose any data when we run this script? which data it will truncate in the log file and where it is saved. Please let me know... USE DatabaseName GO DBCC SHRINKFILE(<TransactionLogName>, 1) BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY DBCC SHRINKFILE(<TransactionLogName>, 1) GO
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)