1

Does SQL Server 2008 have a built in debugger? I've got a stored procedure that returns an error if it is fed a string of alphabetic characters (as opposed to numeric) and I'd like to be able to determine what line it gets to before returning an error.

5 Answers 5

2

Yes, you can debug SQL stored procedures, functions, triggers, etc.

http://www.mssqltips.com/tip.asp?tip=1695

Sign up to request clarification or add additional context in comments.

Comments

1

SQL Server Management Studio can debug stored procedures in SQL Server 2008. Open your stored procedure, and instead of hitting the "execute" button (the red exclamation mark) hit the "debug" button (the green "play" arrow).

http://www.mssqltips.com/tip.asp?tip=1695

Comments

1

I would add PRINT 'Checkpoint A passed' type statements at various points to see how far it gets.. the output would appear on the Messages tab. It's a lame way of debugging, but it works.

insert into blah blah blah

print 'Passed the insert'

select blah

print 'Passed the select'

Comments

1

You can try the Transact SQL Debugger I've never used it but remember reading about it somewhere.

Comments

0
N'' +[TitleOfCourtesy]+ N'' +[FirstName]+ N' ' +[LastName]+ N'there are ' +abs(datediff(day,dateadd(year,(year(getdate())-year([BirthDate])),[BirthDate]),getdate()))+ N' days left untill your birthdate' 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.