我正在尝试将自定义字符串与一个 int 变量连接起来。Investigation is pending for ['+ @investigationidout +']. 当我将鼠标指针悬停在第一个+标志上时,它说:
'+' 附近的语法不正确
这可能吗 ?
我需要看到类似的东西:
1234 的调查正在等待中
我的查询:
EXEC sp_wf_create_notification
@processid,
@vactivityid,
@vstepid,
1,
@vidColumn,
@vidColumnTable,
@investigationidout,
@owner,
'Pending Investigation',
'Investigation is pending for ['+ @investigationidout +'] '
@nextstepurl,
@vstatus OUTPUT,
@verror OUTPUT
Run Code Online (Sandbox Code Playgroud) 是否可以在具有比镜像更高 SQL Server 版本的镜像设置中拥有 SQL Server 见证?
IE。镜像在 SQL Server 2012 Standard 上,见证使用 SQL Server 2014 Express。
我在我的 SQL Server 上强制加密。我的意图是拒绝任何不使用 SSL 进行连接的客户端连接。我在正确的轨道上吗?
这是我的详细步骤:
我还缺什么吗?
我正在使用 10.0.19-MariaDB-1~trusty-log 版本,我只能使用 innodb_force_recovery=6 重新启动 mysqld,我不知道为什么。
/usr/sbin/mysqld 的输出如下:
root@birdwatch:~> /usr/sbin/mysqld
151112 12:49:53 [Note] /usr/sbin/mysqld (mysqld 10.0.19-MariaDB-1~trusty) starting as process 4603 ...
151112 12:49:53 [Note] InnoDB: Using mutexes to ref count buffer pool pagesfile=hey_prova --log-output=FILE
151112 12:49:53 [Note] InnoDB: The InnoDB memory heap is disabled
151112 12:49:53 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
151112 12:49:53 [Note] InnoDB: Memory barrier is not used
151112 12:49:53 [Note] InnoDB: Compressed tables use zlib 1.2.8
151112 12:49:53 [Note] InnoDB: Using Linux native …Run Code Online (Sandbox Code Playgroud) 创建备份时,SQL Server 会猜测(?)初始备份文件的大小。稍后,也许当它附加日志时,大小会被重新调整,有时会多次调整,直到达到最终大小。差异越大,备份所需的时间就越长。(与另一个备份相比,稍后不会调整大小)。示例:Database1(大小为 500GB,使用了 70GB 的日志)通过压缩进行备份。创建的 .bak 文件大小为 85 GB,一段时间后 CPU 使用率上升,我可以看到 .bak 文件重新调整为 136 GB,这种情况再次发生,直到备份的最终大小为 178GB到达。
当这些重新计算发生时,与同一台机器上的其他备份相比,以 MB/s 为单位的平均备份速度会降低。唯一来自附加和清除日志吗?还是因为数据库中使用的数据类型不同?意味着它们以不同的压缩率压缩,或者其他什么?
我来到这个话题,因为我知道我的备份需要大约 30 分钟,但现在即使数据库没有增长到其大小的 300%,也需要 1.5 小时。它仅增长了 30%。
使用等待统计数据,我可以看到除了 BackupIO 之外,我还在某个时候等待 CPU (SOS_SCHEDULER_YIELD)。
Machine Details:
VMWare 6.0
32 GB of Memory (Max memory 28GB given to SQL Server)
2 logical CPU
Max Degree of Parallelism (1, it's a Sharepoint 2013)
SQL Server 2014
Windows Server 2012 R2
running on an SSD Raid (5)
Run Code Online (Sandbox Code Playgroud)
当然,我为运行备份的用户启用了即时文件初始化。
我的备份计划是:
所有数据库备份都存储在我的电脑上。
我向我的数据库添加了一些错误的更改,现在我需要在 SSMS 的帮助下将其恢复到时间点 (SQL Server 2012)。
首先我用 NORECOVERY 恢复了最后一次完整备份,它恢复成功,然后我尝试用 NORECOVERY 恢复最后一次差异备份并收到以下错误消息:
由于 LSN 链中断,无法创建恢复计划。
请指教。我究竟做错了什么?
我正在尝试查询一个表,其中包含一段时间内记录的学生成绩集合。我想生成一个结果集,获取学生 id、一年级、一年级日期、最后一年级、最后一年级日期。
我想我需要使用MIN和MAX函数和一些子查询来实现这一点,但我只是没有得到我需要的结果。
有没有一种有效的方法可以在 PostgreSQL 上实现以下结果?
数据库示例:
user_id | grade | grade_date
1 | A | 01/05/2016
1 | B | 01/15/2016
1 | C | 01/31/2016
2 | A | 01/05/2016
2 | B | 01/15/2016
2 | C | 01/31/2016
3 | A | 01/05/2016
3 | B | 01/15/2016
3 | C | 01/31/2016
4 | A | 01/05/2016
4 | B | 01/15/2016
4 | C | 01/31/2016
Run Code Online (Sandbox Code Playgroud)
我的目标是:
user_id | first_grade …Run Code Online (Sandbox Code Playgroud) 在过去的一年中,我们遇到了许多不同的查询同时失败并出现以下错误(或不同资源调控器组中的变体)的情况:资源池“默认”中的系统内存不足,无法运行此错误询问。
最近我们越来越频繁地遇到它。关于导致问题的原因以及如何解决的任何想法?
@@version 返回:
Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64) 2015 年 10 月 20 日 15:36:27 版权所有 (c) Microsoft Corporation 企业版:Windows NT 6.1(内部版本 7601)上的基于核心的许可(64 位) : 服务包 1)
全部同时发生的示例错误:
Error: 701, Severity: 17, State: 54.
There is insufficient system memory in resource pool 'default' to run this query.
Error: 701, Severity: 17, State: 123.
There is insufficient system memory in resource pool 'dm' to run this query.
Error: 701, Severity: 17, State: 89.
There is insufficient …Run Code Online (Sandbox Code Playgroud) 经过多次搜索,我找不到如何做到这一点。
我的网络搜索得到 Pivots 和 Concats 以及 Cases 和 Subqueries 等,但没有一个能很好地解决我的问题。多行到单行的问题对我没有帮助。
问题:
一张桌子上有个人。另一个表中有这些个人的地址(有时是多个)。我需要一个查询来将每个个人的多个地址放在一行(在适当的列中)。
这是一个带有表和查询的 MySQL Fiddle:
在那个 SQL Fiddle 中,结果有 6 个独特个体的 9 条记录:
Number | Name | EyeColor | HairColor | Street | City | State | Zip | Street2 | City2 | State2| Zip2 | Street3 | ...
1 | John Smith | blue | red | 100 Pine Street | New York | NY | 10019 | | | | 0 | | ...
2 …Run Code Online (Sandbox Code Playgroud) 我对 PL/SQL 完全陌生。我编写了以下 PL/SQL 脚本。但它不执行并给出编译错误:
set serveroutput on SIZE 1000000;
IF EXISTS (select * from my_table)
begin
dbms_output.put_line('has rows');
end;
else
begin
dbms_output.put_line('no rows');
end;
Run Code Online (Sandbox Code Playgroud)
谁能告诉我这有什么问题?
我怎样才能做到这一点?
sql-server ×6
backup ×2
mysql ×2
compression ×1
innodb ×1
mariadb ×1
memory ×1
oracle ×1
parameter ×1
performance ×1
pivot ×1
plsql ×1
postgresql ×1
restore ×1
ssl ×1