TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

SQLite Attach Database

SQLite Attach Database with history, features, advantages, installation, commands, syntax, datatypes, operators, expressions, databases, table, crud operations, clauses, like, glob, limit, and clause, advance sqlite

<< Back to SQLITE

SQLite Attach Database

What is Attach database?

Assume a condition where you have multiple databases available and you have to use only one of them at a time. That's why ATTACH DATABASE statement is used. It facilitates you to select a particular database and after using this command, all SQLite statements will be executed under the attached database.

Syntax:

ATTACH DATABASE 'DatabaseName' As 'Alias-Name'; 

Note: The above syntax will also create a database if the database is not already present, otherwise it will only attach a database file name with the logical database Alias-Name.

Let's take an example. We have an existing database JTP.db.

Example:

ATTACH DATABASE 'JTP.db' as 'JavaTpoint'; 
Sqlite Attach database 1

Database is attached now you can see it by using .databases command:

Sqlite Attach database 2




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf