Skip to content

Commit 93d53c5

Browse files
authored
Merge pull request #19885 from arvindshmicrosoft/arvindsh/syntax-fixes-2
Fix syntax errors in code samples
2 parents b8cf70a + 748b015 commit 93d53c5

7 files changed

Lines changed: 14 additions & 10 deletions

docs/relational-databases/errors-events/database-engine-events-and-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SELECT message_id AS Error, severity AS Severity,
2222
[Event Logged] = CASE is_event_logged WHEN 0 THEN 'No' ELSE 'Yes' END,
2323
text AS [Description]
2424
FROM sys.messages
25-
WHERE language_id = <desired language, such as 1033 for US English>
25+
WHERE language_id = 1040 /* replace 1040 with the desired language ID, such as 1033 for US English*/
2626
ORDER BY message_id
2727
```
2828

docs/relational-databases/errors-events/mssqlserver-137-database-engine-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ DECLARE @mycol nvarchar(20) ;
6464

6565
SET @mycol = 'Name';
6666

67-
EXECUTE ('SELECT ' + @mycol + ' FROM Production.Product';) ;
67+
EXECUTE ('SELECT ' + @mycol + ' FROM Production.Product;') ;
6868
```
6969

7070
## See Also

docs/relational-databases/errors-events/mssqlserver-17892-database-engine-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Another situation where log on triggers fail is when using the `EVENTDATA` funct
101101
User didn't maintain case when copying this script from the internet on this part of the trigger:
102102

103103
```sql
104-
SELECT EVENTDATA ().value ( '(/event_instance/clienthost)[1]' , 'NVARCHAR(15)' ));
104+
SELECT EVENTDATA().value ( '(/event_instance/clienthost)[1]' , 'NVARCHAR(15)');
105105
```
106106

107107
As a consequence, `EVENTDATA` always returned **NULL**, and all his SA equivalent logins were denied access. In this case, the DAC connection was not enabled, so we had no choice but to restart the server with the startup parameters listed above to drop the trigger.

docs/relational-databases/errors-events/mssqlserver-2814-database-engine-error.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ The following table lists the reasons for recompilation.
5555
OBJECT_NAME(st.objectid) AS object_name,
5656
st.text
5757
FROM sys.dm_exec_query_stats AS qs
58-
CROSS APPLY sys.dm_exec_sql_text (*sql_handle*) AS st
59-
WHERE qs.statement_start_offset = *starting_offset*
60-
AND qs.statement_end_offset = *ending_offset*
61-
AND qs.plan_handle = *plan_handle*;
58+
CROSS APPLY sys.dm_exec_sql_text (0x01000600B74C2A1300D2582A2100000000000000000000000000000000000000000000000000000000000000 /* replace the 0x01000600B... value with the actual sql_handle*/) AS st
59+
WHERE qs.statement_start_offset = 123 /*replace 123 with actual starting_offset value*/
60+
AND qs.statement_end_offset = 456 /*replace 456 with actual ending_offset value*/
61+
AND qs.plan_handle = 0x06000100A27E7C1FA821B10600 /*replace 0x06000100A27E7C1FA821B10600with actual plan_handle value*/;
6262
```
6363

6464
2. Based on the reason code description, modify the statement, batch, or procedure to avoid recompilations. For example, a stored procedure may contain one or more SET statements. These statements should be removed from the procedure. For additional examples of recompilation causes and resolutions, see [Batch Compilation, Recompilation, and Plan Caching Issues in SQL Server 2005](/previous-versions/sql/sql-server-2005/administrator/cc966425(v=technet.10)).

docs/relational-databases/errors-events/mssqlserver-3988-database-engine-error.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@ In this situation, an attempt to run the query may raise either of the two error
4949
To work around the issue, enclose the distributed query in a 'begin distributed transaction' statement:
5050

5151
```sql
52-
BEGIN DISTRIBUTED TRANSACTION <Distributed Query> COMMIT TRANSACTION
52+
BEGIN DISTRIBUTED TRANSACTION
53+
/*The actual Distributed Query goes next, outside of comments*/
54+
COMMIT TRANSACTION
5355
```

docs/relational-databases/errors-events/mssqlserver-3989-database-engine-error.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@ In this situation, an attempt to run the query may raise either of the two error
4949
To work around the issue, enclose the distributed query in a 'begin distributed transaction' statement:
5050

5151
```sql
52-
BEGIN DISTRIBUTED TRANSACTION <Distributed Query> COMMIT TRANSACTION
52+
BEGIN DISTRIBUTED TRANSACTION
53+
/*The actual Distributed Query goes next, outside of comments*/
54+
COMMIT TRANSACTION
5355
```

docs/relational-databases/errors-events/mssqlserver-605-database-engine-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ If the 605 error is not transient, the problem is severe and must be corrected b
6464

6565
JOIN sys.filegroups AS fg ON fg.data_space_id = au.data_space_id
6666

67-
WHERE au.allocation_unit_id = `allocation_unit_id` OR au.allocation_unit_id = `allocation_unit_id`
67+
WHERE au.allocation_unit_id = '<allocation_unit_id>' OR au.allocation_unit_id = '<allocation_unit_id>'
6868

6969
ORDER BY au.allocation_unit_id;
7070

0 commit comments

Comments
 (0)