问题标签 [sql-server-2014-express]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1547 浏览

vba - 将空白 VBA 变量作为 Null 插入 SQL 十进制(x,y)字段

我在 Excel 2013 VBA 中有一个 ADODB 命令,用于在我的 SQL Server 2014 中的某些字段为 Decimal(x,y) 的表中执行插入字符串。当我的 excel 单元格为空以将其作为 NULL 插入时遇到问题SQL。

IE。

VBA代码:

假设变量sPrice可以指向一个空的 excel 单元格。

我的 Insert 的论点可以说:

SQL 数据类型中的注意事项是:

所以我不包括 sPrice 的双单引号,因为它是小数。谢谢,

0 投票
2 回答
146 浏览

sql - 启动 MS SQL Server

我刚刚在我的 Win 8.1 机器上下载并安装了MS SQL Server 2014 Express 。不幸的是,我不知道如何运行它。
我只需要一个简单的客户端,我可以在其中运行我的 SQL 语句并使用与 Windows 相关的编程语言进行一些处理。

这是我的文件夹结构的样子:

截屏

我已经阅读了“启动、停止、暂停、恢复、重新启动数据库引擎、SQL Server 代理或 SQL Server 浏览器服务”,但这不是我想要的。

0 投票
2 回答
119 浏览

sql-server - Search for string in a text column and list the count

Ok, I may be asking very stupid question but somehow I am not able to get a way to perform the following.

I have a table that contains two columns as below

Now I have other table that holds the "Key Words" like below

Now I would like to "Search for String" in first table based on "tags" in second table and return something like this

As "Process" keyword appears eight times in the entire table (first table) across multiple rows it returns the count as 8.

I am using SQL Server 2014 Express Edition

0 投票
0 回答
385 浏览

c# - Storing a large set of ngrams in a SQL Server database as fast as possible

I have 14 files of prepared word-based 3-grams and Total Size of the txt files is 75GB. The ngram is separated by ";" and the word that follows the word sequence is separated by "|". Now I want to count how often a word follows a 3-word-sequence. Because of the amount of data I need to do it as fast as possible.

My approach was:

  1. Split line by ngram, by separator ;
  2. Split ngram by separator |
  3. Store the ngram in two tables sequences and words and count how often the word appears to that sequence in the words table

I have SQL Server 2014 Express and my tables have the following structure:

  • [dbo].[sequences]: Id | Sequence
  • [dbo].[words]: Id | sid | word | count

The sequence table should be clear, and in the words table the sid is the related sequence id, the word is the word string, and count is the int number which counts how often the word appeared after that sequence.

My following solution needs at the beginning about 1 second per line, which is far to slow. I tried to use Parallel, but then I get a SQL error, I guess because the table is locked when another process is inserting something.

My program:

How can I process the ngrams faster, so that I won't need an exorbitant amount of time?

P.S.: I'm totally new to C# and Natural Language Processing.

Edit 1: As requested a sample ngram, from which there are about 4 or 5 in each line (but with different word combinations of course): much the same | like;

Edit 2: When I change the code to the following I get the error System.AggregateException: At least one failure occured ---> System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first., just like here.

Edit 3: When adding MultipleActiveResultSets=true to the connection string, I don't get any errors using Parallel. I replaced all relevant loops with the Parallel equivalent, and I run through all files just counting line numbers (169521628 lines), also I have calculated the average time needed for 1 line, which is 0,051502946 sec. Even then I would need about 101 days!

0 投票
1 回答
1000 浏览

sql - 无法使用 SQL Server Management Studio 2012 管理 SQL Server Express 2014

客户已将数据库从 SQL Server Express 2008 升级到 SQL Server Express 2014。

我失去了在 2014 数据库的设计模式下编辑数据或打开表的能力。我仍然可以编写存储过程来完成这些任务。

我成功地使用 SQL Server Management Studio 2012 编辑数据并对 SQL Server Express 2008 数据库进行更改,并且仍然可以存档副本。

谁能建议 SQL Server Management Studio 2012 是否可用于编辑数据和更改 SQL Server Express 2014 数据库?

0 投票
1 回答
122 浏览

sql - 如何合并表并防止 ID 冲突

我想将 IndirectFlights 表合并到 PriceTable。我没有在 SourceTable (IndirectFlights) 中输入 ID,也没有为它设置 PK。PriceTable 的 ID 列是 Identity (1,1) 列,也是主键。

Qs1 如何在 Source 列中输入 ID,以免它们与目标表 (PriceTable) ID 冲突?我正在考虑使用一个序列,但它可能在未来发生冲突。Qs2 我可以选择要合并的列还是必须合并源表中的所有列?

编辑:我刚刚运行了以下 Union All 语句作为使用 Merge 的替代方法。

代码有效,但我注意到 ID 列接受了来自 IndirectFlights.ID 的 Null 值,尽管我将 ID 列设置为 Not Null。

谁能解释一下。也有人可以解释我如何从这个 Union All 语句创建一个新的永久表。

0 投票
1 回答
59 浏览

sql-server - 我想使用 SQL Server 2014 Express 设置一个允许空值的唯一约束

我想使用 SQL Server 2014 Express 设置一个允许空值的唯一约束。我知道以前有人问过这个问题,但 5 年前在这篇文章中有人问过这个问题。

如何创建一个也允许空值的唯一约束?

我才刚刚开始学习 SQL,所以我想看看自 5 年前以来是否有任何其他选项可用。

我正在考虑使用唯一过滤索引,但我想尽可能避免使用此索引。

谢谢你。

0 投票
1 回答
540 浏览

c# - 本地连接到 SQL Server 2014 Express 的问题

我无法连接到我的本地数据库,它在实时版本上运行良好。Live 版本是 SQL Server 2012,测试环境是 SQL Server 2014 Express。

我正在使用 Web Matrix 3 和附加到进程的 Visual Studio 2013 调试器,但我现在几乎尝试了所有方法?我认为问题与连接问题有关。但我当然可以从 Management Studio 连接到数据库。

这是我的连接字符串

有人有什么想法吗?

0 投票
3 回答
1556 浏览

vb.net - 无法使用 VS 2013 Professional(特别是 VB)连接到 MSSQL Express 2014 数据库

在获取文件正在使用消息时,我阅读了另一篇关于此问题的文章。我进入 SQL Management Studio 并断开了数据库的连接,但仍然没有成功连接。这是一步一步发生的事情:

我下载了 SQL Express 2014 并安装了它。我创建了一个名为 MyEntertainmentDB 的数据库,然后创建了几个文件(电影和评级)。我向两者都添加了一些数据。我启动了 VS,并在 VB 中创建了一个表单,添加了包括数据网格在内的各种控件。DB 存在于 MS SQL 使用的默认位置。我单击了智能标记,出现了数据网格视图任务窗口。我单击选择数据源下拉箭头,然后添加项目数据源。数据库突出显示,然后单击下一步。数据集突出显示,然后单击下一步。现在我单击新连接并选择 Microsoft SQL Server 数据库文件(数据提供程序是 SQL Server 的 .NET Framework 数据提供程序(该下拉框中唯一的内容)),然后单击继续。现在我' m 在第一个框中显示了一个数据源为 Microsoft SQL Server 数据库文件 (SqlClient) 的窗口,我浏览到我的数据库所在的位置并选择它(即 C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS \MSSQL\DATA\MyEntertainmentDB.mdf)。一切顺利,我正在使用 Windows 身份验证。我点击确定。现在它等待几分钟,我收到这条消息:

尝试附加到数据库失败并显示以下消息:建立与 SQL Server 的连接时发生网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接。(提供者:SQL 网络接口,错误:50 - 发生本地数据库运行时错误。无法创建自动实例。有关错误详细信息,请参阅 Windows 应用程序事件日志。

我查看了 SQL Server 日志,但没有提到任何内容。我找不到任何 VS 日志。我检查了 Windows 日志,但找不到任何看似相关的内容。我对这个问题不知所措,准备丢弃 MS SQL 服务器,只使用 MS Access 2010 或 MySQL。有人看到我哪里出错了吗?如果是这样,请帮忙,我试图非常具体,希望我已经提供了所有必要的信息。

0 投票
0 回答
32 浏览

sql-server-2014-express - 如何在不损坏原始数据库的情况下将 SQL Server 2014 Express 数据库复制到同一服务器

我在笔记本电脑上运行 SQL Server 2014 Express。

我想知道如何在不损坏或覆盖原始数据库的情况下将数据库复制到同一个 SQL Server 实例。

我想保留旧数据库并将其用于测试。

我看过下面的前两篇文章,但看不到明确的答案。

在 SQL Server Express 中复制数据库?

在 sql server 2012 express 中创建数据库副本

提前感谢您提供的任何帮助。