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.
| Author |
Topic |
|
sharmasumit45
Starting Member
9 Posts |
Posted - 2008-01-15 : 03:45:59
|
| Hi every One,I am new to Sql and I find it dificult to write complex Sp(Stored Procedures).Can you please help me in understanding the debugging of Sp.Thanks In advancesumit |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-15 : 04:36:04
|
| One crude method of debugging is to give print statements after query batches and checking intermediate results.Also go through this link to learn usage of query analyser in debugging:-[url]http://articles.techrepublic.com.com/5100-9592_11-5768655.html[/url] |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-01-15 : 05:02:00
|
| in ss 2k5 you can debug only in visual studio._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out |
 |
|
|
sharmasumit45
Starting Member
9 Posts |
Posted - 2008-01-15 : 23:11:21
|
| Thanks a lot guys you are wonderful.I am not expecting the answer so early.Actually I am new to programming and also to this forum.I hope in future also I will get the help from you guys Thanks visakh16 and spirit1.Regardssumit |
 |
|
|
sharmasumit45
Starting Member
9 Posts |
Posted - 2008-01-17 : 08:06:59
|
| Can you help me in one more thing When ever I see a complex Stored procedure I feel scared.But I can see people using print command use to debug it and also some are using sql profiler to trace the database updates/changes.I am scared how can they do this so effortlessely.Actally I don't know these two technique can you please help me with example script.Regards |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-01-17 : 08:48:29
|
| declare @id intselect @id = 3select ... where someId = @idprint('@id=' + @cast(id as varchar(10)) -- this is for debug reasons..--etc..._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out |
 |
|
|
|
|
|