Share on Facebook

Monday, September 10, 2012

How to import CSV / Excel file to SQL Server Table

How to Load Excel File / CSV File to a SQL Server Table / Create SQL Server Table from Excel File

Step 1: Select Import and Export Wizard from Program

Step 2: Select Import and Export Wizard from Program

 Step 3: Select Flat File as Source

Step 4: Select the CSV / Text file

Step 5: Choose the Server

Step 6: Choose Database

Step 7: Specify Schema and Table Names
 Step 8: Run the Pachage

Share on Facebook

Specified column precision 50 is greater than the maximum precision of 38.

What is the Preferred Data Type for Price and Amount Fields

This error occurs when you are trying to define a Decimal field with precision more than 38. If you would require more precission, please use any of the following:

[Sales Price] [Numeric](50,2) NULL,

[Quantity] [int](50) NULL,

[Amount] [Numeric](50,2) NULL,


CREATE TABLE [dbo].[Transact.Details](
[Store ID] [varchar](50) NULL,
[Customer ID] [varchar](50) NULL,
[Transaction ID] [varchar](50) NULL,
[Transaction Date] [varchar](50) NULL,
[Category ID] [varchar](50) NULL,
[Item ID] [varchar](50) NULL,
[Sales Price] [Numeric](38,2) NULL,
[Quantity] [int] NULL,
[Amount] [Numeric](38,2) NULL,
Related Posts Plugin for WordPress, Blogger...