我尝试使用大小为1.4 GB的.csv文件中的大量数据加载我的数据库.但是当我尝试运行我的代码时,我会遇到错误.
这是我的代码:
USE [Intradata NYSE]
GO
CREATE TABLE CSVTest1
(Ticker varchar(10) NULL,
dateval date NULL,
timevale time(0) NULL,
Openval varchar(10) NULL,
Highval varchar(10) NULL,
Lowval varchar(10) NULL,
Closeval varchar(10) NULL,
Volume varchar(10) NULL
)
GO
BULK
INSERT CSVTest1
FROM 'c:\intramerge.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
--Check the content of the table.
SELECT *
FROM CSVTest1
GO
--Drop the table to clean up database.
DROP TABLE CSVTest1
GO
Run Code Online (Sandbox Code Playgroud)
我尝试建立一个包含大量库存报价的数据库.但我收到此错误消息:
消息4832,级别16,状态1,行2批量加载:在数据文件中遇到意外的文件结尾.消息7399,级别16,状态1,行2链接服务器"(null)"的OLE DB提供程序"BULK"报告错误.提供商未提供有关错误的任何信息.消息7330,级别16,状态2,行2无法从OLE DB提供程序"BULK"获取链接服务器"(null)"的行
我不太了解SQL,但我希望能抓到一两件事.希望有人看到可能非常明显的东西.
我有一个WindowsApplication项目,其中Reference-folder缺少一个文件.我将它与我找到该文件的另一个项目进行了比较,它应该在这里找到:References-> System-> System.Net-> HttpWebRequest
如何将此文件添加到我的项目中,为什么不自动加载,我做错了什么?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GetStockData
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
string ticker = this.tbTicker.Text;
DateTime startDate = this.dtpStart.Value;
DateTime endDate = this.dtpEnd.Value;
int startMonth = startDate.Month - 1;
int endMonth = endDate.Month - 1;
string theURL = @"http://ichart.finance.yahoo.com/table.csv?s="
+ ticker + @"&a=" + startMonth.ToString() + @"&b=" + startDate.Day.ToString()
+ @"&c=" + startDate.Year.ToString() + …
Run Code Online (Sandbox Code Playgroud)