You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Table-Valued Parameters (Database Engine)](/previous-versions/sql/sql-server-2008/bb510489(v=sql.100)) in SQL Server Books Online | Describes how to create and use table-valued parameters |
33
33
|[User-Defined Table Types](/previous-versions/sql/sql-server-2008/bb522526(v=sql.100)) in SQL Server Books Online | Describes user-defined table types that are used to declare table-valued parameters |
34
-
| The [Microsoft SQL Server Database Engine](https://go.microsoft.com/fwlink/?LinkId=120507) section of CodePlex | Contains samples that demonstrate how to use SQL Server features and functionality |
34
+
35
35
36
36
## Passing multiple rows in previous versions of SQL Server
37
37
@@ -309,4 +309,4 @@ The following methods have been added to this class to support passing of table-
309
309
310
310
## See also
311
311
312
-
[Overview of the JDBC driver](overview-of-the-jdbc-driver.md)
312
+
[Overview of the JDBC driver](overview-of-the-jdbc-driver.md)
Copy file name to clipboardExpand all lines: docs/relational-databases/clr-integration-database-objects-user-defined-functions/clr-table-valued-functions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ go
173
173
```
174
174
175
175
## Sample: Returning the Results of a SQL Server Query
176
-
The following sample shows a table-valued function that queries a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. This sample uses the AdventureWorks Light database from [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)]. See [https://www.codeplex.com/sqlserversamples](https://go.microsoft.com/fwlink/?LinkId=87843) for more information on downloading AdventureWorks.
176
+
The following sample shows a table-valued function that queries a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. This sample uses the AdventureWorks Lightweight database from [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)], see the [AdventureWorks sample databases](/sql/samples/adventureworks-install-configure#download-backup-files)
177
177
178
178
Name your source code file FindInvalidEmails.cs or FindInvalidEmails.vb.
Copy file name to clipboardExpand all lines: docs/relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types-coding.md
The purpose of the padding is to ensure that the culture is completely separated from the currency value, so that when one UDT is compared against another in [!INCLUDE[tsql](../../includes/tsql-md.md)] code, culture bytes are compared against culture bytes, and currency byte values are compared against currency byte values.
617
617
618
-
For the complete code listing for the **Currency** UDT, follow the directions for installing the CLR samples in [SQL Server Database Engine Samples](https://msftengprodsamples.codeplex.com/).
619
-
620
618
### Currency Attributes
621
619
The **Currency** UDT is defined with the following attributes.
622
620
@@ -739,9 +737,5 @@ public void Read(System.IO.BinaryReader r)
739
737
}
740
738
```
741
739
742
-
For the complete code listing for the **Currency** UDT, see [SQL Server Database Engine Samples](https://msftengprodsamples.codeplex.com/).
743
-
744
740
## See Also
745
-
[Creating a User-Defined Type](../../relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types.md)
746
-
747
-
741
+
[Creating a User-Defined Type](../../relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types.md)
Copy file name to clipboardExpand all lines: docs/relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,6 @@ Reconfigure
37
37
## Example
38
38
The following code listing defines the Point UDT, which is described in detail in [Coding User-Defined Types](../../relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types-coding.md).
39
39
40
-
The complete code listings for the other examples discussed in this section can be obtained by installing the CLR samples. For instructions on installing these samples, see [SQL Server Database Engine Samples](https://msftengprodsamples.codeplex.com/).
Copy file name to clipboardExpand all lines: docs/relational-databases/clr-integration/assemblies/creating-an-assembly.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ FROM 'C:\MyDBApp\SQLCLRTest.dll';
45
45
- The assembly that is called or referenced was created in the same database.
46
46
47
47
## Specifying Security When Creating Assemblies
48
-
When creating an assembly into a [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] database, you can specify one of three different levels of security in which your code can run: **SAFE**, **EXTERNAL_ACCESS**, or **UNSAFE**. When the **CREATE ASSEMBLY** statement is run, certain checks are performed on the code assembly which may cause the assembly to fail to register on the server. For more information, see the Impersonation sample on [CodePlex](https://msftengprodsamples.codeplex.com/).
48
+
When creating an assembly into a [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] database, you can specify one of three different levels of security in which your code can run: **SAFE**, **EXTERNAL_ACCESS**, or **UNSAFE**. When the **CREATE ASSEMBLY** statement is run, certain checks are performed on the code assembly which may cause the assembly to fail to register on the server.
49
49
50
50
**SAFE** is the default permission set and works for the majority of scenarios. To specify a given security level, you modify the syntax of the CREATE ASSEMBLY statement as follows:
In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you can move the data, log, and full-text catalog files of a user database to a new location by specifying the new file location in the FILENAME clause of the [ALTER DATABASE](../../t-sql/statements/alter-database-transact-sql.md) statement. This method applies to moving database files within the same instance [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. To move a database to another instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] or to another server, use [backup and restore](../../relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases.md) or [detach and attach operations](../../relational-databases/databases/move-a-database-using-detach-and-attach-transact-sql.md).
31
+
32
+
> [!NOTE]
33
+
> This article covers moving user database files. For moving system database files, see [Move System Databases](../../relational-databases/databases/move-system-databases.md).
32
34
33
35
## Considerations
34
36
When you move a database onto another server instance, to provide a consistent experience to users and applications, you might have to re-create some or all the metadata for the database. For more information, see [Manage Metadata When Making a Database Available on Another Server Instance (SQL Server)](../../relational-databases/databases/manage-metadata-when-making-a-database-available-on-another-server.md).
35
37
36
-
Some features of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] change the way that the [!INCLUDE[ssDE](../../includes/ssde-md.md)] stores information in the database files. These features are restricted to specific editions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. A database that contains these features cannot be moved to an edition of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that does not support them. Use the sys.dm_db_persisted_sku_features dynamic management view to list all edition-specific features that are enabled in the current database.
38
+
Some features of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] change the way that the [!INCLUDE[ssDE](../../includes/ssde-md.md)] stores information in the database files. These features are restricted to specific editions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. A database that contains these features cannot be moved to an edition of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that does not support them. Use the `sys.dm_db_persisted_sku_features` dynamic management view to list all edition-specific features that are enabled in the current database.
37
39
38
-
The procedures in this topic require the logical name of the database files. To obtain the name, query the name column in the [sys.master_files](../../relational-databases/system-catalog-views/sys-master-files-transact-sql.md) catalog view.
40
+
The procedures in this article require the logical name of the database files. To obtain the name, query the name column in the [sys.master_files](../../relational-databases/system-catalog-views/sys-master-files-transact-sql.md) catalog view.
39
41
40
42
Starting with [!INCLUDE[ssKilimanjaro](../../includes/sskilimanjaro-md.md)], full-text catalogs are integrated into the database rather than being stored in the file system. The full-text catalogs now move automatically when you move a database.
43
+
44
+
> [!NOTE]
45
+
> Make sure the service account for the [SQL Server Database Services service](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md) has permissions to the new file location in the file system. For more information, see [Configure File System Permissions for Database Engine Access](../../database-engine/configure-windows/configure-file-system-permissions-for-database-engine-access.md).
41
46
42
47
## Planned Relocation Procedure
43
48
To move a data or log file as part of a planned relocation, follow these steps:
44
49
45
50
1. For each file to be moved, run the following statement.
2. Run the following statement to bring the database offline.
52
57
53
-
```
58
+
```sql
54
59
ALTER DATABASE database_name SET OFFLINE;
55
60
```
61
+
62
+
This action requires exclusive access to the database. If another connection is open to the database, the ALTER DATABASE statement will be blocked until all connections are closed. To override this behavior, use the [`WITH <termination>` clause](../../t-sql/statements/alter-database-transact-sql-set-options.md#with-termination-). For example, to automatically rollback and disconnect all other connections to the database, use:
63
+
64
+
```sql
65
+
ALTER DATABASE database_name SET OFFLINE WITH ROLLBACK IMMEDIATE;
66
+
```
56
67
57
68
3. Move the file or files to the new location.
58
69
59
70
4. Run the following statement.
60
71
61
-
```
72
+
```sql
62
73
ALTER DATABASE database_name SET ONLINE;
63
74
```
64
75
65
76
5. Verify the file change by running the following query.
66
77
67
-
```
78
+
```sql
68
79
SELECT name, physical_name AS CurrentLocation, state_desc
69
80
FROM sys.master_files
70
81
WHERE database_id = DB_ID(N'<database_name>');
@@ -75,7 +86,7 @@ ms.author: wiassaf
75
86
76
87
1. For each file to be moved, run the following statement.
77
88
78
-
```
89
+
```sql
79
90
ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path\os_file_name' );
80
91
```
81
92
@@ -87,7 +98,7 @@ ms.author: wiassaf
87
98
88
99
5. Verify the file change by running the following query.
89
100
90
-
```
101
+
```sql
91
102
SELECT name, physical_name AS CurrentLocation, state_desc
92
103
FROM sys.master_files
93
104
WHERE database_id = DB_ID(N'<database_name>');
@@ -105,21 +116,21 @@ ms.author: wiassaf
105
116
106
117
- For the default (MSSQLSERVER) instance, run the following command.
107
118
108
-
```
119
+
```console
109
120
NET START MSSQLSERVER /f /T3608
110
121
```
111
122
112
123
- For a named instance, run the following command.
113
124
114
-
```
125
+
```console
115
126
NET START MSSQL$instancename /f /T3608
116
127
```
117
128
118
129
For more information, see [Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service](../../database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services.md).
119
130
120
131
3. For each file to be moved, use **sqlcmd** commands or [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] to run the following statement.
121
132
122
-
```
133
+
```sql
123
134
ALTER DATABASE database_name MODIFY FILE( NAME = logical_name , FILENAME = 'new_path\os_file_name' );
124
135
```
125
136
@@ -135,7 +146,7 @@ ms.author: wiassaf
135
146
136
147
8. Verify the file change by running the following query.
137
148
138
-
```
149
+
```sql
139
150
SELECT name, physical_name AS CurrentLocation, state_desc
140
151
FROM sys.master_files
141
152
WHERE database_id = DB_ID(N'<database_name>');
@@ -144,7 +155,7 @@ ms.author: wiassaf
144
155
## Examples
145
156
The following example moves the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] log file to a new location as part of a planned relocation.
146
157
147
-
```
158
+
```sql
148
159
USE master;
149
160
GO
150
161
-- Return the logical file name.
@@ -172,12 +183,13 @@ WHERE database_id = DB_ID(N'AdventureWorks2012')
[Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service](../../database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services.md)
- [Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service](../../database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services.md)
Copy file name to clipboardExpand all lines: docs/relational-databases/databases/tempdb-database.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: "tempdb database"
3
-
description: This topic provides details about the configuration and use of the tempdb database in SQL Server and Azure SQL Database.
3
+
description: This article provides details about the configuration and use of the tempdb database in SQL Server and Azure SQL Database.
4
4
ms.custom: "P360"
5
-
ms.date: 07/02/2021
5
+
ms.date: 10/28/2021
6
6
ms.prod: sql
7
7
ms.prod_service: "database-engine"
8
8
ms.technology:
@@ -226,11 +226,12 @@ Metadata contention in `tempdb` has historically been a bottleneck to scalabilit
226
226
227
227
This feature effectively removes this bottleneck and unlocks a new level of scalability for tempdb-heavy workloads. In [!INCLUDE[sql-server-2019](../../includes/sssql19-md.md)], the system tables involved in managing temporary table metadata can be moved into latch-free, non-durable, memory-optimized tables.
228
228
229
+
Currently the memory-optimized tempdb metadata feature is not available in Azure SQL Database or Azure SQL Managed Instance.
230
+
229
231
Watch this seven-minute video for an overview of how and when to use memory-optimized tempdb metadata:
Copy file name to clipboardExpand all lines: docs/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ ms.custom: seo-dt-2019
87
87
To use impersonation, the configuration must meet the requirement for delegation.
88
88
89
89
**Remote User**
90
-
Use the remote user to map users not defined in **Local login**. The **Remote User** must be a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Authentication login on the remote server.
90
+
Use the remote user to map user defined in **Local login**. The **Remote User** must be a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Authentication login on the remote server.
0 commit comments