Tecnología / Importar Txt A SQL
Importar Txt A SQLEnsayos para estudiantes: Importar Txt A SQL
Ensayos de Calidad, Tareas, Monografias - busque más de 2.271.000+ documentos.
Enviado por: luisguerraavila 14 junio 2012
Palabras: 1296 | Páginas: 6
How to Import a Comma Separated File into SQL Server 2008
BY ASHISH KUMAR MEHTA
Database Administrators and SSIS Developers will often come across scenarios where they need to import a comma separated delimited text file into SQL Server. Providing the data in comma separated delimited text file is a very common practice which is used by many organizations around the world. Once the delimited text file is generated the files can be compressed and FTP’d to a client location from where it can be picked up and loaded into SQL Server 2008 using SQL Server Integration Services. In this article you will see the steps which you need to follow in order to create a SQL Server Integration Services Package which can be used to import data from a comma separated delimited text file into SQL Server.
Different Methods to Create an SSIS Package
You can create an SSIS package either by using Business Intelligent Development Studio or by using SQL Server Management Studio (SSMS). In this article you will see how to create an SSIS package using SQL Server Management Studio (SSMS) to import a comma separated delimited text file into SQL Server 2008.
Create an SSIS Package Using SQL Server Management Studio (SSMS)
1. Connect to SQL Server 2008 Instance using SQL Server Management Studio.
2. In the Object Explorer, expand the Databases Node and select the AdventureWorks databases. In this example you will be importing data from SalesCustomer.txt comma separated delimited text file which was generated using the SSIS package created in my previous article titled “How to Create a Comma Separated Delimited Text File Using SQL Server 2008”. The data will be imported into dbo.SalesCustomer table in TempDB database.
3. Right click the AdventureWorks database and select Tasks ? Export Data… as shown in the below snippet. This will open up SQL Server Import and Export Wizard. You can also open the same wizard by typing DTSWIZARD from Start | Run | CMD.
e the SQL Server Import and Export Wizard opens up you will see a welcome screen as shown in the below snippet. If you are not interested in seeing the welcome screen next time whenever you are using the SQL Server Import and Export wizard then you can select the check box “Do not show this starting page again” so that next time when you are using this wizard the welcome screen does not show up. Click Next to continue with the wizard.
5. In Choose a Data Source wizard screen you need to select the Data Source as Flat File Source from the drop-down list. Next you need to browse and provide the path of the file which has data that needs to be imported into SQL Server 2008. Select the Locale value from the drop down list as “English (United States)” and then you need to choose the appropriate code page, for this example the code page value which you need to selected is 1252 (ANSI- Latin 1). As your source file is a delimited text file, you need to choose Delimited as t ...
Suscríbase a ClubEnsayos
Suscríbase a ClubEnsayos - busque más de 2.271.000+ documentos