How to export SQL Server Express database or specific table to SQL file? - import

I have SQL Server 2012 Express and I want to export the whole database or certain tables to a .SQL file (SQL Script). .BAK file will not work in my case.

Related

Error when trying to import with CSV file format in Cloud SQL

HTTPError 400: Unknow export file type was thrown when I try to Import csv file from my Cloud Storage bucket into my Cloud SQL db. Any idea what I missed out.
Reference:
gcloud sql import csv
CSV files are not supported in Cloud SQL, MS SQL Server. As mentioned here,
In Cloud SQL, SQL Server currently supports importing databases using
SQL and BAK files.
Somehow, it is supported for MySQL and PostgreSQL versions of Cloud SQL.
You could perform one of the next solutions:
Change the database engine to either PostgreSQL or MySQL (where CSV files are supported).
If the data on your CSV file came from an on-premise SQL Server DB table, you can create an SQL file from it, then use it to import into Cloud SQL, SQL Server.

how to convert microsoft 2016 sql ddl load scripts to postgres sql

I would like to translate Microsoft SQL Server DDL and table load sql commands to the Postgres equivalent.
There are a number of tools to convert one database to another in the link below but are there parsers for ddl/sql script conversion?
https://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Microsoft_SQL_Server

Failed to retrieve long data for column varbinary (max)

We have created several packages using the import utility of MS SQL 2016. In each import, we are copying data from a SQL 2016 database to another SQL 2016 database with the same database schema. All the packages are working fine except one. In this one import, we are copying a column of varbinary(max). When I execute this import using import utility, everything works fine. When I execute this as a SQL agent job, it fails with the error: Failed to retrieve long data for column "Samples" Code: 0xC020901C on the source. In the XML of the import .dtsx, I see that the column is intepreted as dataType="image". Should I change this datatype? How can I make this work from the agent?
A team mate had found the answer: The proxy credentials did not have access to write to the temp directory of the SQL Server Agent account. Temp directory was necessary for writing the varbinary column. We didn't realise that the temp directory was being used and although the tasks were running under the proxy credential, SQL server agent account was being used for the temp folder.

to import sql files in mysql workbench

Daily backup schedular of my database is taken. I want to ask how this sql file generated can be imported in other system through Mysql Workbench 5.2 CE. I have tired following:
Server Administrator->Manage Import/Export->Data import/restore->import from self conntained file->(giving the file path of sql file to be imported)File path->(select database object was blank i could not add my database to which it is imported)->start import.
i get- ERROR 1046 (3D000) at line 22: No database selected
Please provide me proper steps as to how the sql files be import in workbench.

Copy a table with data to another db in SQL server 2005 express

I have a database with a table. I want copy it along with the data to another database.
How can I do this in SQL server 2005 express?