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 |
|
rajkumarrai_bis
Yak Posting Veteran
78 Posts |
Posted - 2007-01-23 : 23:12:53
|
| I m trying following code in sql server 2005but it is giving errorBEGIN TRY -- Generate divide-by-zero error. SELECT 1/0;END TRYBEGIN CATCH -- Execute the error retrieval routine. print 'Error'END CATCH;Errors areMsg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near 'TRY'.Msg 156, Level 15, State 1, Line 4Incorrect syntax near the keyword 'END'.Thanks in advancei need this urgently |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-01-23 : 23:17:53
|
are you sure you are running this in a SQL Server 2005 server ? The query runs fine in my 2005 server but in 2000, it gives the same error message. KH |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-01-24 : 12:03:58
|
i think he's connecting to sql server 2000 through management studio and mistakes one for 2k5.Go with the flow & have fun! Else fight the flow blog thingie: http://weblogs.sqlteam.com/mladenp |
 |
|
|
rajkumarrai_bis
Yak Posting Veteran
78 Posts |
Posted - 2007-01-24 : 18:13:44
|
| Yeah you are right i got to know that through @@version thanks guys |
 |
|
|
|
|
|