官术网_书友最值得收藏!

Importing flat files

Many information systems can provide us with flat files as a sort of exported data. We can import those flat files directly into SQL Server via Management Studio, where you can select the Import Flat File option from the database tasks. Then, you can choose to import the .csv or .txt files, which will be imported into a new table. While you're choosing the table name, you can also select, via the drop-down list, a schema for the table. 

Flat files are also generated by many systems as log files, which can then be further analyzed in SQL Server as one of the possible tools. In such cases, the import would be more complex, since you would not aim for one file, but more for a folder structure containing hundreds or thousands of files, where the required data is stored. 

Importing the content of a single flat file can be achieved via SQL Server Management Studio, which has a specific task to work with flat files:

Once you open the dialog, you need to find the flat file on the disk and choose how the new table should be named in your database. This table will be created based on the structure of your flat file. In the next dialog window, you can configure the required data types for all columns from the imported file.

This wizard will automatically determine the field separator and will analyze the data for the suggested data type for you:

主站蜘蛛池模板: 益阳市| 班戈县| 虎林市| 宜州市| 界首市| 宁化县| 彰化市| 曲周县| 莒南县| 互助| 江安县| 雅江县| 鄂托克旗| 东丽区| 华蓥市| 南投县| 封开县| 侯马市| 怀化市| 皋兰县| 黔西县| 盐池县| 乐清市| 江津市| 绥芬河市| 广州市| 金寨县| 西昌市| 大洼县| 井研县| 全椒县| 民丰县| 临夏县| 安龙县| 阜南县| 石河子市| 大安市| 客服| 罗江县| 南康市| 穆棱市|