SQL Server Errors Question:
Download Questions PDF

Suppose I have table nametemp in that I wanted to add some partial data for a particular column name policyno where data is existing in that column. Ex.Policyno like R-KT-SK-EA-134526 like 100 records. In that 100 records some policynos are just like 134527 I mean with out prefix likeR-KT-SK-EA- now I wanted add this prefix as R-KT-SK-EA-134527 for some 50 records. How can I add partial data?

Answer:

UPDATE temp SET = REPLACE(Policyno,'134527','R-KT-SK-EA-134527') WHERE Policyno = '134527'

UPDATE temp SET = 'R-KT-SK-EA'+ Policyno WHERE Policyno = '134527'

UPDATE temp SET = 'R-KT-SK-EA'+ Policyno WHERE policyno not like 'R-KT-SK-EA-%'

Download SQLServer Errors Interview Questions And Answers PDF

Previous QuestionNext Question
What is tcp?How to solve "The SQL Server service failed to start. For more information, see the SQL Server Books Online topics" error?