Monday, 28 September 2009

T-Sql replace a word with another word

ITs the replace function

And in mycase i just wanted to say replace the word - 'comment please' with a blank space

SQL TYPE

varchar

northwind and pubs

http://msdn.microsoft.com/en-us/library/ms143221.aspx

Using T-SQL in Sql Server

http://justgeeks.blogspot.com/2008/08/using-t-sql-cursor-in-sql-server.html

DECLARE @price money
DECLARE @get_price CURSOR

SET @get_price = CURSOR FOR
SELECT price FROM titles
OPEN @get_price
FETCH NEXT FROM @get_price INTO @price
WHILE (@@FETCH_STATUS = 0)

BEGIN IF @Price < 20 SELECT ‘Under 20′ ELSE SELECT @Price
FETCH NEXT FROM @get_price INTO @priceEND

CLOSE @get_price
DEALLOCATE @get_price

--------------------------------------------------------------------------------------