Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 6559345

Browse files
authored
Merge pull request #19886 from arvindshmicrosoft/arvindsh/syntax-fixes-3
Fix minor syntax errors
2 parents 447ec22 + d42c8f4 commit 6559345

7 files changed

Lines changed: 40 additions & 25 deletions

docs/connect/oledb/ole-db-how-to/results/execute-stored-procedure-with-odbc-call-and-process-output.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ ms.author: v-daenge
5151

5252
Execute the third ( [!INCLUDE[tsql](../../../../includes/tsql-md.md)]) code listing to delete the stored procedure used by the application.
5353

54-
```
54+
```sql
5555
USE AdventureWorks
5656
if exists (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[myProc]'))
5757
DROP PROCEDURE myProc
5858
GO
5959

6060
CREATE PROCEDURE myProc
61-
@inparam nvarchar(5),,
61+
@inparam nvarchar(5),
6262
@outparam int OUTPUT
6363

6464
AS
@@ -73,7 +73,7 @@ ELSE
7373
GO
7474
```
7575

76-
```
76+
```cpp
7777
// compile with: ole32.lib oleaut32.lib
7878
void InitializeAndEstablishConnection();
7979

@@ -345,7 +345,7 @@ void InitializeAndEstablishConnection() {
345345
}
346346
```
347347
348-
```
348+
```sql
349349
USE AdventureWorks
350350
DROP PROCEDURE myProc
351351
GO

docs/relational-databases/indexes/columnstore-indexes-data-warehouse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ BEGIN TRAN
115115
-- The query plan chooses a seek operation on the nonclustered index
116116
-- and takes the row lock
117117
SELECT * FROM t_account WHERE AccountKey = 100;
118-
END TRAN
118+
COMMIT TRAN
119119
```
120120

121121
### Snapshot isolation and read-committed snapshot isolations

docs/relational-databases/json/optimize-json-processing-with-in-memory-oltp.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ CREATE TABLE xtp.Product(
120120
INDEX [idx_Product_MadeIn] NONCLUSTERED (MadeIn)
121121

122122
) WITH (MEMORY_OPTIMIZED=ON)
123+
GO
123124

124125
ALTER TABLE Product
125126
ADD INDEX [idx_Product_Cost] NONCLUSTERED HASH(Cost)
@@ -142,6 +143,7 @@ AS BEGIN
142143
JOIN OPENJSON(@ProductIds)
143144
ON ProductID = value
144145
END;
146+
GO
145147

146148
CREATE PROCEDURE xtp.UpdateProductData(@ProductId int, @Property nvarchar(100), @Value nvarchar(100))
147149
WITH SCHEMABINDING, NATIVE_COMPILATION
@@ -152,6 +154,7 @@ AS BEGIN
152154
SET Data = JSON_MODIFY(Data, @Property, @Value)
153155
WHERE ProductID = @ProductId;
154156
END
157+
GO
155158
```
156159

157160
## Learn more about JSON in SQL Server and Azure SQL Database

docs/relational-databases/json/solve-common-issues-with-json-in-sql-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SELECT col1, col2, col3,
3636
(SELECT col11, col12, col13 FROM t11 WHERE t11.FK = t1.PK FOR JSON PATH) as t11,
3737
(SELECT col21, col22, col23 FROM t21 WHERE t21.FK = t1.PK FOR JSON PATH) as t21,
3838
(SELECT col31, col32, col33 FROM t31 WHERE t31.FK = t1.PK FOR JSON PATH) as t31,
39-
JSON_QUERY('{"'+col4'":"'+col5+'"}') as t41
39+
JSON_QUERY('{"'+col4+'":"'+col5+'"}') as t41
4040
FROM t1
4141
FOR JSON PATH
4242
```

docs/relational-databases/logs/control-transaction-durability.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||
8888
### <a name="bkmk_DbControl"></a> Database level control
8989
You, the DBA, can control whether users can use delayed transaction durability on a database with the following statement. You must set the delayed durability setting with ALTER DATABASE.
9090

91-
```sql
91+
```syntaxsql
9292
ALTER DATABASE ... SET DELAYED_DURABILITY = { DISABLED | ALLOWED | FORCED }
9393
```
9494

@@ -104,7 +104,7 @@ ALTER DATABASE ... SET DELAYED_DURABILITY = { DISABLED | ALLOWED | FORCED }
104104
### <a name="CompiledProcControl"></a> Atomic block level control - Natively Compiled Stored Procedures
105105
The following code goes inside the atomic block.
106106

107-
```sql
107+
```syntaxsql
108108
DELAYED_DURABILITY = { OFF | ON }
109109
```
110110

@@ -117,15 +117,15 @@ DELAYED_DURABILITY = { OFF | ON }
117117
**Example Code:**
118118

119119
```sql
120-
CREATE PROCEDURE <procedureName> ...
120+
CREATE PROCEDURE [<procedureName>] /* parameters go here */
121121
WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER
122122
AS BEGIN ATOMIC WITH
123123
(
124124
DELAYED_DURABILITY = ON,
125125
TRANSACTION ISOLATION LEVEL = SNAPSHOT,
126126
LANGUAGE = N'English'
127-
...
128127
)
128+
/* procedure body goes here */
129129
END
130130
```
131131

@@ -139,9 +139,8 @@ END
139139
### <a name="bkmk_T-SQLControl"></a> COMMIT level control -[!INCLUDE[tsql](../../includes/tsql-md.md)]
140140
The COMMIT syntax is extended so you can force delayed transaction durability. If DELAYED_DURABILITY is DISABLED or FORCED at the database level (see above) this COMMIT option is ignored.
141141

142-
```sql
142+
```syntaxsql
143143
COMMIT [ { TRAN | TRANSACTION } ] [ transaction_name | @tran_name_variable ] ] [ WITH ( DELAYED_DURABILITY = { OFF | ON } ) ]
144-
145144
```
146145

147146
**OFF**

docs/relational-databases/native-client-odbc-table-valued-parameters/sending-data-as-a-table-valued-parameter-using-data-at-execution-odbc.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,24 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-s
3232
This procedure assumes that the following [!INCLUDE[tsql](../../includes/tsql-md.md)] has been executed on the server:
3333

3434
```sql
35-
create type TVParam as table(ProdCode integer, Qty integer)
36-
create procedure TVPOrderEntry(@CustCode varchar(5), @Items TVPParam,
37-
@OrdNo integer output, @OrdDate datetime output)
38-
as
39-
set @OrdDate = GETDATE();
40-
insert into TVPOrd (OrdDate, CustCode) values (@OrdDate, @CustCode) output OrdNo);
41-
select @OrdNo = SCOPE_IDENTITY();
42-
insert into TVPItem (OrdNo, ProdCode, Qty)
43-
select @OrdNo, @Items.ProdCode, @Items.Qty
44-
from @Items
35+
CREATE TYPE TVParam AS TABLE (
36+
ProdCode INT,
37+
Qty INT);
38+
GO
39+
40+
CREATE PROCEDURE TVPOrderEntry
41+
@CustCode VARCHAR (5), @Items TVPParam, @OrdNo INT OUTPUT, @OrdDate DATETIME OUTPUT
42+
AS
43+
SET @OrdDate = GETDATE();
44+
INSERT INTO TVPOrd (OrdDate, CustCode)
45+
OUTPUT inserted.OrdNo
46+
VALUES (@OrdDate, @CustCode);
47+
SELECT @OrdNo = SCOPE_IDENTITY();
48+
INSERT INTO TVPItem (OrdNo, ProdCode, Qty)
49+
SELECT @OrdNo,
50+
@Items.ProdCode,
51+
@Items.Qty
52+
FROM @Items;
4553
```
4654

4755
## To Send the Data
@@ -67,7 +75,7 @@ from @Items
6775

6876
2. Bind the parameters. *ColumnSize* is 1, meaning that at most one row is passed at a time.
6977

70-
```sql
78+
```cpp
7179
// Bind parameters for call to TVPOrderEntryByRow.
7280
r = SQLBindParameter(hstmt, 1, SQL_C_CHAR, SQL_PARAM_INPUT,SQL_VARCHAR, 5, 0, CustCode, sizeof(CustCode), &cbCustCode);
7381

docs/relational-databases/native-client-ole-db-how-to/filestream/send-data-to-a-filestream-column-using-irowsetfastupload-ole-db.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,13 @@ MainCleanup:
584584
```
585585
586586
```sql
587-
sp_detach_db 'DBFsa'
588-
IF EXISTS (SELECT name FROM master..sysdatabases WHERE name = 'DBFsa') DROP DATABASE [DBFsa] |
587+
EXEC sp_detach_db 'DBFsa'
588+
GO
589+
590+
IF EXISTS (SELECT name
591+
FROM master..sysdatabases
592+
WHERE name = 'DBFsa')
593+
DROP DATABASE [DBFsa];
589594
```
590595

591596

0 commit comments

Comments
 (0)