May 16, 2011 at 9:37 am
Hi Folks
I am trying to use this bit of code that I have found just about everywhere but it does not seem to work as advertised. Can someone assist in the error I am getting ?
Than
had to upload as an attachment as i kept getting a Network Error if i copied and pasted it
Thanks
Jim
May 16, 2011 at 10:22 am
Probably because of some oddball characters. You should put it in the code tag
USE [msdb]
GO
XXXXX msdb.dbo.sp_add_alert @name=N’Severity 016',
@message_id=0,
@severity=16,
@enabled=1,
@delay_between_responses=60,
@include_event_description_in=1,
@job_id=N’00000000-0000-0000-0000-000000000000'
GO
XXXXX msdb.dbo.sp_add_notification @alert_name=N’Severity 016', @operator_name=N’SQL Server Administrator’, @notification_method = 7
GO
Results:
1> USE [msdb]
2> GO
Changed database context to 'msdb'.
1> EXEC msdb.dbo.sp_add_alert @name=N’Severity 016',
2~ @message_id=0,
3~ @severity=16,
4~ @enabled=1,
5~ @delay_between_responses=60,
6~ @include_event_description_in=1,
7~ @job_id=N’00000000-0000-0000-0000-000000000000'
8> GO
Msg 102, Level 15, State 1, Server NSAB-SS80-SQL-N, Line 1
Incorrect syntax near '''.
1> EXEC msdb.dbo.sp_add_notification @alert_name=N’Severity 016', @operator_name=N’SQL Server Administrator’, @notification_method = 7
2~ GO
That being done it looks like you probably copied and pasted this from somewhere because the quotes are mismatched. Some of them are correct single quotes and others look like right single quote which is what Word does. Try replacing ` with ' and see if that gets you there.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 16, 2011 at 10:26 am
i could not figure how to put the code in and use a code tag
any instructions would be appreciated
Jim
May 16, 2011 at 10:29 am
<-- When typing there is a box over on the left. You can click any of those and it will insert the tag into the text box over here where you are typing.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 16, 2011 at 10:36 am
Hi Sean
that was it
thanks
one other quirk when i type some incorrect sql in the sqlcmd window i get a "~" after the number
how do you get out of that back to the number 1
everytime i hit [Ctrl} c, i get kicked out of sqlcmd
15~
16~
17~
18~
19~
20~
21~
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply