Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export table structures and data from ms access as txt file

I am new in ms access In mysql we can export table structure as create query like the following

CREATE TABLE IF NOT EXISTS `audio_master` (
  `audio_id` int(11) NOT NULL AUTO_INCREMENT,
  `audio_title` varchar(255) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`audio_id`)
)  


INSERT INTO `audio_master` (`audio_id`, `audio_title`, `course_id`) VALUES
(1, 'java audio', 1);

Like this I need to take from MS Access. How I can export like this using ms Access or sql server

Any suggestions or answers highly appreciated

Thanks in advance

like image 991
user1187 Avatar asked Oct 15 '25 08:10

user1187


1 Answers

If you're using SQL Server Management Studio 2014:

  1. Right-click on the database and click on Tasks -> Generate Scripts...
  2. You'll be directed to an Introduction Page. Click Next.
  3. Select database objects to script. You can either script the entire database or some specific database objects only. Click Next.
  4. You'll be directed to the Set Scripting Options tab. Click the Advanced button.
  5. Under the General category, go to Types of data to script.
  6. Select Schema and data and click OK.
  7. Select output type. Click Next.
  8. Click Next then Finish.

You'll now have the CREATE TABLE statement together with the INSERT statements.


For SSMS 2008

  1. Right-click on the database and click on Tasks -> Generate Scripts...
  2. Select database objects to script. You can either script the entire database or some specific database objects only. Click Next.
  3. Under the Table/View Options category, go to Script Data and set it to True.
  4. Choose object types. Click Next and select the SPs, Tables or Views you want to script.
  5. Choose from Output Option. You can either Script to file or Script to New Query Window. Click Next, then Finish.
like image 155
Felix Pamittan Avatar answered Oct 16 '25 20:10

Felix Pamittan