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

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:

主站蜘蛛池模板: 读书| 和田市| 嘉峪关市| 大邑县| 长葛市| 渝北区| 河西区| 永胜县| 镇宁| 黄冈市| 砚山县| 法库县| 江川县| 丰宁| 出国| 昌乐县| 玉门市| 科技| 宁波市| 慈溪市| 汤阴县| 呼和浩特市| 辽中县| 嘉峪关市| 武宣县| 仁寿县| 永州市| 天峻县| 邯郸县| 屯昌县| 古丈县| 岚皋县| 霍林郭勒市| 兰州市| 石棉县| 曲阜市| 漳平市| 凌源市| 翼城县| 通海县| 河津市|