Here is an example how to import the data which is in Flat File to SQL Server database.
In my example, I kept the Flat file by the name source.txt on C:\Documents and Settings\Dhinakaran\Desktop\texting
Source.txt is comma seperated value (CSV).
Now i want to load this value into SAMPLE Database of SQL Server (Local system).
to achieve this, Open SSMS.
Select SAMPLE database.
Right click, Select Task, then Import option under task and Give NEXT.
New Import and Export Wizard window will open
You will be guided to next window Screen and here you are asked to select the data Source type. In this case we are using Flat file and So select flat file from Drop down button under Data Source Option.
After selecting, Source type, Browse for the Flat file and in my case Flat file is at C:\Documents and Settings\Dhinakaran\Desktop\texting and Next check Column Names in first row data option if u r first row of flat file indicates column name. In my example i'm check marking that option.
Next we can Select Advanced option and There we can Rename the column in the way we want to use in database.
After renaming, Give Next and it will be guided to new screen.
Here, select destination server and prompt it with user name and password and give Next.
And continue giving next as shown in following Pictures.
and after success, Give close and Run SELECT * FROM SOURCE in SSMS and check whether files have Populated to local server or not.
In my example, I kept the Flat file by the name source.txt on C:\Documents and Settings\Dhinakaran\Desktop\texting
Source.txt is comma seperated value (CSV).
Now i want to load this value into SAMPLE Database of SQL Server (Local system).
to achieve this, Open SSMS.
Select SAMPLE database.
Right click, Select Task, then Import option under task and Give NEXT.
New Import and Export Wizard window will open
You will be guided to next window Screen and here you are asked to select the data Source type. In this case we are using Flat file and So select flat file from Drop down button under Data Source Option.
After selecting, Source type, Browse for the Flat file and in my case Flat file is at C:\Documents and Settings\Dhinakaran\Desktop\texting and Next check Column Names in first row data option if u r first row of flat file indicates column name. In my example i'm check marking that option.
Next we can Select Advanced option and There we can Rename the column in the way we want to use in database.
After renaming, Give Next and it will be guided to new screen.
Here, select destination server and prompt it with user name and password and give Next.
And continue giving next as shown in following Pictures.
and after success, Give close and Run SELECT * FROM SOURCE in SSMS and check whether files have Populated to local server or not.
Comments
Post a Comment