Jan
29
2009
1

Search SQL stored procedure, show line result

I felt the need to search for a text string in SQL 2005 within a stored procedure.
EASY! yes… but then you get the stored procedure name, and if you want … the text. The text isn’t very useful when it is one giant string now, is it?

So here is a little script I made. It will return the stored procedure name, the line of text where the string was found – and the line number. handy you say……?

DECLARE
@TextString varchar(100)

SET
@TextString = ” ——- YOUR STRING HERE

DECLARE
@ProcName varchar(100)
DECLARE @Results TABLE(ProcName varchar(100), ProcLineNo int, ProcLine varchar(1000))

DECLARE blah CURSOR FOR
SELECT DISTINCT
[Name]
FROM
SysObjects AS O (NOLOCK)
JOIN SysComments AS C (NOLOCK) ON O.Id = C.Id WHERE [Text] LIKE ‘%’+ @TextString +’%’
ORDER BY
[Name]

OPEN blah
FETCH NEXT FROM blah INTO @ProcName
WHILE @@FETCH_STATUS = 0
BEGIN

CREATE TABLE #ProcLines ([lineNo] int IDENTITY(1,1), line varchar(1000))

INSERT INTO
#ProcLines
EXEC sp_helptext @ProcName

INSERT INTO
@Results
SELECT
@ProcName,
[lineNo],
line
FROM
#ProcLines
WHERE
line LIKE ‘%’ + @TextString +’%’

DROP TABLE #ProcLines

FETCH NEXT FROM blah INTO @ProcName
END

CLOSE blah
DEALLOCATE blah

SELECT
*
FROM
@Results

Jan
27
2009
0

HP 2605 magenta faded (Updated 2 Mar 2009)

This is how to fix it. Please comment if I have helped you.

One of my client’s printers is a bit faulty and the HP repair centre couldn’t repair it. So I am going to take it upon myself to follow instructions from another blog on how to clean the laser lenses… updates will follow….

Here is the first update: Found the original blog, and an HP support forum both mentioning the same issue.

The issue is the MAGENTA colour printing faded colours.

HP forum

Reeves-Hall

I put in double links because sometimes the thumbnails don’t generate…

UPDATE:

I opened up the machine I had and fixed the issue. A little bit of dust on the lens and mirror was the culprit.

On the Reeves link, it took the guy quite a while, I managed to get it all done in under two hours. Also, you don’t necessarily need to take off the side panels – I did do it, but one could probably get away without taking them off.

Marking of the cables is important, I just used a fine tipped permanent market to colour the cable corresponding to the positioning. I counted positions 1 to 6, and then made the mark on the relevant cable.

I added the quote from HP’s official repair place. The quote is higher than the price of a new printer. And it was for something that isn’t even broken!

See the pictures below :)

Jan
27
2009
1

Updated theme

I updated my theme to this interesting new one. I still want to edit it to automatically rotate the background… when I get some time :)

Jan
22
2009
1

Judging a book by it’s cover

Richard (from work) stumbled across a very interesting book review….

  • There was once a composer called Wagner
  • He once composed a piece called “The Ring”
  • A book was written named “Penetrating Wagner’s Ring”

Just read the reviews! clickety click.

Written by Quentin in: Chatter | Tags: , ,
Jan
19
2009
0

Auto thumbnail

This is just a quick test of a new plugin I installed….

It allows you to add a URL and then it automatically generates a thumbnail! Trying it out on the OOC forum and Taryn’s site. Very cool indeed.

Written by Quentin in: One Liners |

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com