Import and Export Data Flashcards

1
Q

Besides backup and restore, what’s another way that you can move data from one server to another?

A

You can DETACH and REATTACH it.

EXEC MASTER.DBO.SP_DETACH_DB @DBNAME = N’DATABASENAME’

CREATE DATABASE [DATABASENAME] ON ( FILENAME = N’MDF’),(FILENAME = N’LDF’) FOR ATTACH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the GUI ways for importing/exporting data?

A

IMPORT FLAT FILE
IMPORT DATA
EXPORT DATA
COPY DATABASE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the t-sql syntax for BULK INSERT?

A
BULK INSERT [TABLENAME]
FROM 'C:\PATH'
WITH (
    FIELDTERMINATOR = ',', --DELIMITER
    ROWTERMINATOR = '\n', --NEW LINE
    FIRSTROW = 2 --WHERE DATA STARTS
)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which SQL Program creates a package for IMPORT/EXPORT DATA?

A

SSIS (SQL SERVER INTEGRATION SERVICE)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly