Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 updating column

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-01-25 : 00:34:04
hi iam having table A where c and d are columns.

now my reqirement is like if c is null then i need to take first 20 characters of d column value and put it into column c.how to do this

rohan_chikhale
Starting Member

7 Posts

Posted - 2010-01-25 : 00:46:56
Check from front end whether whether any data is returned in c, if not then read the d column and fire an insert statement for c column.

Rohan Chikhale
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-01-25 : 00:48:25
update emrdiagnosissnippets set TITLE=(substring(DIAG_SNIPPET_DESC,1,20))where TITLE is null

can i do like this
Go to Top of Page

rohan_chikhale
Starting Member

7 Posts

Posted - 2010-01-25 : 00:53:22
Cant say, try it...if it works good for u... :)

Rohan Chikhale
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-01-25 : 02:33:35
"can i do like this"

Yes
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-01-25 : 02:46:22
quote:
Originally posted by rajasekhar857

update emrdiagnosissnippets set TITLE=(substring(DIAG_SNIPPET_DESC,1,20))where TITLE is null

can i do like this


[See if you come back to reply to this]

What happens when new data are added periodically?

[/See if you come back to reply to this]


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -