5

SQL SERVER - Attach an In-Memory Database with T-SQL - SQL Authority with Pinal...

 3 years ago
source link: https://blog.sqlauthority.com/2020/12/21/sql-server-attach-an-in-memory-database-with-t-sql/?utm_campaign=sql-server-attach-an-in-memory-database-with-t-sql
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Attach an In-Memory Database with T-SQL

SQL SERVER – Attach an In-Memory Database with T-SQL

Earlier I wrote a blog post about SQL SERVER – Attach a Database with T-SQL. Right after reading this blog post, my client of Comprehensive Database Performance Health Check sent me an email asking if there is any other method when we have to attach an In-Memory Database with T-SQL. The question is very valid as SSMS graphical user interface does not support attaching an in-memory database. Let us learn how we can do that today.

SQL SERVER - Attach an In-Memory Database with T-SQL withtsql-1-800x230

Here is the script which works with In-Memory Database.

CREATE DATABASE [AdventureWorks] ON
( FILENAME = N'D:\Data\AdventureWorks.mdf' ),
( FILENAME = N'E:\Log\AdventureWorks_log.ldf' ),
(FILENAME = N'G:\InMemoryFolder')
FOR ATTACH
GO

When you are moving the in-memory database, make sure that you remember the name of the file stream folder where the in-memory objects are stored and you can specify that after specifying data and log file as a filename in the script.

I have not found much help on the internet on this topic, hence this blog post. If there is any inaccuracy in the script or any other method to attach the in-memory database via T-SQL, please leave a comment and I will be happy to share the same blog readers with due credit to you.

I like to create small videos teaching valuable lessons about T-SQL, you can subscribe to my channel SQL in Sixty Seconds to learn new stuff about technology.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Database Training Days

SQLGrease

Melissa

Red-Gate

Pinal Dave is a SQL Server Performance Tuning Expert and an independent consultant. He has authored 12 SQL Server database books, 35 Pluralsight courses and has written over 5200 articles on the database technology on his blog at a https://blog.sqlauthority.com. Along with 17+ years of hands-on experience, he holds a Masters of Science degree and a number of database certifications.

For any SQL Server Performance Tuning Issue send an email at [email protected] .

Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).


Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long term multi-channel campaigns to drive leads for their sales pipeline.


Exclusive Newsletter


Download SQL Server 2019 for FREE

Install SQL Server 2019 in Sixty Seconds


Comprehensive Database Performance Health Check

Is your SQL Server running slow and you want to speed it up without sharing server credentials? In my Comprehensive Database Performance Health Check, we can work together remotely and resolve your biggest performance troublemakers in less than 4 hours.

Once you learn my business secrets, you will fix the majority of problems in the future.


SQL Server Performance Tuning Practical Workshop

Have you ever opened any PowerPoint deck when you face SQL Server Performance Tuning emergencies? SQL Server Performance Tuning Practical Workshop is my MOST popular training with no PowerPoint presentations and 100% practical demonstrations.

Essentially I share my business secrets to optimize SQL Server performance.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK