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
 General SQL Server Forums
 New to SQL Server Programming
 Delete Data

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2012-08-28 : 03:12:46
Hi All,

Just wanted to check how to delete data in this way. Please suggest

I have one table T1 in which i have C1 column in which i have value like this

ABC DEF EGF
FDT GTR TRY
DFRT FGTY HUY
GHTY UYT TREWQ

Now in this i want to delete first values(Before Space) for example in above after running query i should get


DEF EGF
GTR TRY
FGTY HUY
UYT TREWQ

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-08-28 : 04:15:57
update tbl
set col = right(col,len(col)-charindex(' ',col))
where col like '% %'


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -