Skip to content

Commit 84ce7f7

Browse files
committed
System stored procedures: Refresh batch 035
1 parent 4e73145 commit 84ce7f7

60 files changed

Lines changed: 5950 additions & 5175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/includes/big-data-clusters-master-instance-ha-endpoint-requirement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ ms.service: sql
66
ms.topic: include
77
---
88

9-
Certain operations, including configuring server (instance level) settings, or manually adding a database to an availability group, require a connection to the SQL Server Instance. Operations like `sp_configure`, `RESTORE DATABASE`, or any DDL command in a database belonging to an availability group require a connection to the SQL Server instance. By default, a big data cluster does not include an endpoint that enables a connection to the instance. You must expose this endpoint manually.
9+
Certain operations, including configuring server (instance level) settings, or manually adding a database to an availability group, require a connection to the SQL Server instance. Operations like `sp_configure`, `RESTORE DATABASE`, or any DDL command in a database belonging to an availability group require a connection to the SQL Server instance. By default, a big data cluster does not include an endpoint that enables a connection to the instance. You must expose this endpoint manually.
1010

1111
For instructions, see [Connect to databases on the primary replica](../big-data-cluster/deployment-high-availability.md#instance-connect).

docs/relational-databases/system-stored-procedures/sp-addserver-transact-sql.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ dev_langs:
2323

2424
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
2525

26-
Defines the name of the local instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. When the computer hosting [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] is renamed, use `sp_addserver` to inform the instance of the [!INCLUDE [ssDEnoversion](../../includes/ssdenoversion-md.md)] of the new computer name. This procedure must be executed on all instances of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] hosted on the computer. The instance name of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] can't be changed. To change the instance name of a named instance, install a new instance with the desired name, detach the database files from old instance, attach the databases to the new instance, and drop the old instance. Alternatively, you can create a client alias name on the client computer, redirecting the connection to different server and instance name or **server:port** combination without changing the name of the instance on the server computer.
26+
Defines the name of the local instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. When the computer hosting [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] is renamed, use `sp_addserver` to inform the instance of the [!INCLUDE [ssDEnoversion](../../includes/ssdenoversion-md.md)] of the new computer name. This procedure must be executed on all instances of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] hosted on the computer.
27+
28+
The instance name of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] can't be changed. To change the instance name of a named instance, install a new instance with the desired name, detach the database files from old instance, attach the databases to the new instance, and drop the old instance. Alternatively, you can create a client alias name on the client computer, redirecting the connection to different server and instance name or `<server>:<port>` combination without changing the name of the instance on the server computer.
2729

2830
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
2931

@@ -91,3 +93,4 @@ EXEC sp_addserver 'ACCOUNTS', 'local';
9193
- [sp_helpserver (Transact-SQL)](sp-helpserver-transact-sql.md)
9294
- [System stored procedures (Transact-SQL)](system-stored-procedures-transact-sql.md)
9395
- [Security stored procedures (Transact-SQL)](security-stored-procedures-transact-sql.md)
96+
- [Connect to the Database Engine](../../sql-server/connect-to-database-engine.md)
Lines changed: 68 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
title: "sp_can_tlog_be_applied (Transact-SQL)"
3-
description: "sp_can_tlog_be_applied (Transact-SQL)"
3+
description: Verifies whether a transaction log backup can be applied to a SQL Server database.
44
author: markingmyname
55
ms.author: maghan
6-
ms.date: "03/14/2017"
6+
ms.reviewer: randolphwest
7+
ms.date: 07/05/2024
78
ms.service: sql
89
ms.subservice: system-objects
910
ms.topic: "reference"
@@ -16,57 +17,70 @@ dev_langs:
1617
- "TSQL"
1718
---
1819
# sp_can_tlog_be_applied (Transact-SQL)
20+
1921
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
2022

21-
Verifies whether a transaction log backup can be applied to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. **sp_can_tlog_be_applied** requires that the database be in the Restoring state.
22-
23-
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
24-
25-
## Syntax
26-
27-
```
28-
29-
sp_can_tlog_be_applied [ @backup_file_name = ] 'backup_file_name'
30-
, [ @database_name = ] 'database_name'
31-
, [ @result = ] result OUTPUT
32-
```
33-
34-
## Arguments
35-
`[ @backup_file_name = ] 'backup_file_name'`
36-
Is the name of a backup file. *backup_file_name* is **nvarchar(128)**.
37-
38-
`[ @database_name = ] 'database_name'`
39-
Is the name of the database. *database_name* is **sysname**.
40-
41-
`[ @result = ] _result_ OUTPUT`
42-
Indicates whether the transaction log can be applied to the database. *result* is **bit**.
43-
44-
1 = The log can be applies
45-
46-
0= The log cannot be applied.
47-
48-
## Return Code Values
49-
0 (success) or 1 (failure)
50-
51-
## Permissions
52-
Only members of the **sysadmin** fixed server role can execute **sp_can_tlog_be_applied**.
53-
54-
## Examples
55-
The following example declares a local variable, `@MyBitVar`, to store the result.
56-
57-
```
58-
USE master;
59-
GO
60-
DECLARE @MyBitVar BIT;
61-
EXEC sp_can_tlog_be_applied
62-
@backup_file_name =
63-
N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\AdventureWorks2022.bak',
64-
@database_name = N'AdventureWorks2022',
65-
@result = @MyBitVar OUTPUT;
66-
GO
67-
```
68-
69-
## See Also
70-
[System Stored Procedures &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/system-stored-procedures-transact-sql.md)
71-
72-
23+
Verifies whether a transaction log backup can be applied to a [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] database. `sp_can_tlog_be_applied` requires that the database is in the *restoring* state.
24+
25+
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
26+
27+
## Syntax
28+
29+
```syntaxsql
30+
sp_can_tlog_be_applied
31+
[ @backup_file_name = ] N'backup_file_name'
32+
, [ @database_name = ] N'database_name'
33+
[ , [ @result = ] result OUTPUT ]
34+
[ , [ @verbose = ] verbose ]
35+
[ ; ]
36+
```
37+
38+
## Arguments
39+
40+
#### [ @backup_file_name = ] N'*backup_file_name*'
41+
42+
The name of a backup file. *@backup_file_name* is **nvarchar(500)**, with no default.
43+
44+
#### [ @database_name = ] N'*database_name*'
45+
46+
The name of the database. *@database_name* is **sysname**, with no default.
47+
48+
#### [ @result = ] *result* OUTPUT
49+
50+
Indicates whether the transaction log can be applied to the database. *@result* is an OUTPUT parameter of type **bit**.
51+
52+
- `1` = The log can be applies
53+
- `0` = The log can't be applied.
54+
55+
#### [ @verbose = ] *verbose*
56+
57+
[!INCLUDE [ssinternalonly-md](../../includes/ssinternalonly-md.md)]
58+
59+
## Return code values
60+
61+
`0` (success) or `1` (failure).
62+
63+
## Permissions
64+
65+
Only members of the **sysadmin** fixed server role can execute `sp_can_tlog_be_applied`.
66+
67+
## Examples
68+
69+
The following example declares a local variable, `@MyBitVar`, to store the result.
70+
71+
```sql
72+
USE master;
73+
GO
74+
75+
DECLARE @MyBitVar BIT;
76+
77+
EXEC sp_can_tlog_be_applied
78+
@backup_file_name = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\AdventureWorks2022.bak',
79+
@database_name = N'AdventureWorks2022',
80+
@result = @MyBitVar OUTPUT;
81+
GO
82+
```
83+
84+
## Related content
85+
86+
- [System stored procedures (Transact-SQL)](system-stored-procedures-transact-sql.md)
Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
title: "sp_catalogs (Transact-SQL)"
3-
description: "sp_catalogs (Transact-SQL)"
3+
description: sp_catalogs returns the list of catalogs in the specified linked server.
44
author: markingmyname
55
ms.author: maghan
6-
ms.date: "03/14/2017"
6+
ms.reviewer: randolphwest
7+
ms.date: 07/05/2024
78
ms.service: sql
89
ms.subservice: system-objects
910
ms.topic: "reference"
@@ -16,55 +17,59 @@ dev_langs:
1617
- "TSQL"
1718
---
1819
# sp_catalogs (Transact-SQL)
20+
1921
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
2022

21-
Returns the list of catalogs in the specified linked server. This is equivalent to databases in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
22-
23-
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
24-
25-
## Syntax
26-
27-
```
28-
29-
sp_catalogs [ @server_name = ] 'linked_svr'
30-
```
31-
32-
## Arguments
33-
`[ @server_name = ] 'linked_svr'`
34-
Is the name of a linked server. *linked_svr* is **sysname**, with no default.
35-
36-
## Result Sets
37-
38-
|Column name|Data type|Description|
39-
|-----------------|---------------|-----------------|
40-
|**Catalog_name**|**nvarchar(**128**)**|Name of the catalog|
41-
|**Description**|**nvarchar(**4000**)**|Description of the catalog|
42-
43-
## Permissions
44-
Requires SELECT permission on the schema.
45-
46-
## Examples
47-
The following example returns catalog information for the linked server named `OLE DB ODBC Linked Server #3`.
48-
23+
Returns the list of catalogs in the specified linked server. This is equivalent to databases in [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)].
24+
25+
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
26+
27+
## Syntax
28+
29+
```syntaxsql
30+
sp_catalogs [ @server_name = ] N'server_name'
31+
[ ; ]
32+
```
33+
34+
## Arguments
35+
36+
#### [ @server_name = ] N'*server_name*'
37+
38+
The name of a linked server. *@server_name* is **sysname**, with no default.
39+
40+
## Result set
41+
42+
| Column name | Data type | Description |
43+
| --- | --- | --- |
44+
| `CATALOG_NAME` | **nvarchar(128)** | Name of the catalog |
45+
| `DESCRIPTION` | **nvarchar(4000)** | Description of the catalog |
46+
47+
## Permissions
48+
49+
Requires `SELECT` permission on the schema.
50+
51+
## Examples
52+
53+
The following example returns catalog information for the linked server named `OLE DB ODBC Linked Server #3`.
54+
4955
> [!NOTE]
50-
> For **sp_catalogs** to provide useful information, the `OLE DB ODBC Linked Server #3` must already exist.
51-
52-
```
53-
USE master;
54-
GO
55-
EXEC sp_catalogs 'OLE DB ODBC Linked Server #3';
56-
```
57-
58-
## See Also
59-
[sp_addlinkedserver &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-addlinkedserver-transact-sql.md)
60-
[sp_columns_ex &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-columns-ex-transact-sql.md)
61-
[sp_column_privileges &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-column-privileges-transact-sql.md)
62-
[sp_foreignkeys &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-foreignkeys-transact-sql.md)
63-
[sp_indexes &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-indexes-transact-sql.md)
64-
[sp_linkedservers &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-linkedservers-transact-sql.md)
65-
[sp_primarykeys &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-primarykeys-transact-sql.md)
66-
[sp_tables_ex &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-tables-ex-transact-sql.md)
67-
[sp_table_privileges &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-table-privileges-transact-sql.md)
68-
[System Stored Procedures &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/system-stored-procedures-transact-sql.md)
69-
70-
56+
> For `sp_catalogs` to provide useful information, the `OLE DB ODBC Linked Server #3` must already exist.
57+
58+
```sql
59+
USE master;
60+
GO
61+
EXEC sp_catalogs 'OLE DB ODBC Linked Server #3';
62+
```
63+
64+
## Related content
65+
66+
- [sp_addlinkedserver (Transact-SQL)](sp-addlinkedserver-transact-sql.md)
67+
- [sp_columns_ex (Transact-SQL)](sp-columns-ex-transact-sql.md)
68+
- [sp_column_privileges (Transact-SQL)](sp-column-privileges-transact-sql.md)
69+
- [sp_foreignkeys (Transact-SQL)](sp-foreignkeys-transact-sql.md)
70+
- [sp_indexes (Transact-SQL)](sp-indexes-transact-sql.md)
71+
- [sp_linkedservers (Transact-SQL)](sp-linkedservers-transact-sql.md)
72+
- [sp_primarykeys (Transact-SQL)](sp-primarykeys-transact-sql.md)
73+
- [sp_tables_ex (Transact-SQL)](sp-tables-ex-transact-sql.md)
74+
- [sp_table_privileges (Transact-SQL)](sp-table-privileges-transact-sql.md)
75+
- [System stored procedures (Transact-SQL)](system-stored-procedures-transact-sql.md)

0 commit comments

Comments
 (0)