36 热度

SQL Server 2019 community technology preview 3.0 is now available

We’re excited to announce the monthly release of SQL Server 2019 community technology preview (CTP) 3.0. For customers in the Early Adoption Program, CTP 3.0 is the first release where you’re able to run SQL Server 2019 in production. To apply, please reach out to your assigned Program Manager for more information. Check out the What’s new in SQL Server 2019 preview documentation to learn more.

收录时间: 2019-05-23
分类: SQL Server
贡献者: Rector
43 热度

SQL Server 2016 + AlwaysOn 无域集群

创建集群配置集群的管理名称和管理IP等待配置完成可以查看集群报告,稍后配置文件共享见证创建文件共享见证由于我们是两个节点的故障转移集群,所以需要加上共享文件夹,如果是奇数节点,这一步是不需要做的!配置集群仲裁选择文件共享见证在集群节点之外的一台服务器上创建共享文件夹\\XIANGMU4TEST01\share,并设置 Everyone 完全控制的权限配置

收录时间: 2019-05-22
分类: SQL Server
贡献者: Rector
153 热度

SQL Server Management Studio (SSMS) 18.0 released for general availability

When I joined the SQL Tools team as a PM back in October 2018, my top priority was to release SQL Server Management Studio (SSMS) 18. I expected a fair amount of work but didn’t realize how complicated the process would be. 6 months later, having passed several internal checks such as accessibility, privacy, security, compliance, etc. among many others, and after 5 previews, I am very excited to share that SSMS 18 is now generally available. You can download SQL Server Management Studio 18 today.

收录时间: 2019-04-25
分类: SQL Server
贡献者: Rector
83 热度

SQL Server中编写自动生成指定时间段内按小时的连续的数据列表并按每个小时统计数据的SQL语句示例

在我们编写SQL语句的时候,有可能遇到这样的场景:有一张用户信息表,里面记录和用户的一些数据,如:ID,姓名,创建时间…,为了了解每天每个时段(按小时)的用户创建量数据,我们需要从这张用户信息表的数据来统计。其中有可能用户创建时间的小时部分不是连续的,但统计出来的数据需要按小时连续,缺失的小时使用SQL自动补齐。效果展示先看一下我已经为大家准备好...

收录时间: 2019-04-18
分类: SQL Server
贡献者: Rector
121 热度

【SQL】ROW_NUMBER() OVER(partition by 分组列 order by 排序列)用法详解+经典实例

#用法说明select row_number() over(partition by A order by B ) as rowIndex from table A :为分组字段B:为分组后的排序字段。table 表的结构 多为:  多人 多条的相关数据。(比如:订单信息)此条sql语句,多用于对数据进行分组排序,并对每个组中的数据分别进行编号,编号从1开始递增,每个组内的编...

收录时间: 2019-04-04
分类: SQL Server
贡献者: Rector
85 热度

MSSQL - 最佳实践 - 如何打码隐私数据列

在SQL Server安全系列专题月报分享中,我们已经分享了:如何使用对称密钥实现SQL Server列加密技术、使用非对称密钥加密方式实现SQL Server列加密、使用混合密钥实现SQL Server列加密技术、列加密技术带来的查询性能问题以及相应解决方案和行级别安全解决方案这五篇文章,文章详情可以参见往期月报。本期月报我们分享使用SQL Server 2016 dynamic data ...

收录时间: 2019-03-28
分类: SQL Server
贡献者: Rector
AD 友情赞助
229 热度

【Sql Server】SQL SERVER 递归查询

SQL SERVER 2005之前的版本只能用函数方法实现,SQL SERVER 2005之后新增了CTE功能,可以利用CTE实现递归查询;CTE:公用表达式Common Table Expression 是SQL SERVER 2005版本之后引入的一个特性;#填充测试数据1、sql1 Create table GroupInfo1([Id] int,[GroupName] nvarch...

收录时间: 2018-12-23
分类: SQL Server
贡献者: Rector
229 热度

SQL Server 2019 on Linux with a Docker container on Ubuntu

In this article, we will install SQL Server 2019 using the Docker container. Docker is basically an application package which contains all dependencies in the package itself. We can just call the Docker container and provide the configuration parameter to start using the application. Before we install SQL Server 2019 on the virtual machine let us do a few checks and necessary pre-requisites.

收录时间: 2018-11-30
分类: SQL Server
贡献者: Rector
224 热度

Six different methods to copy tables between databases in SQL Server

In this article, you’ll learn the key skills that you need to copy tables between SQL Server instances including both on-premises and cloud SQL databases. In this article, I’ll walk-through several ways of copying a table(s) between SQL databases, helping you to see the benefits and trade-offs of each option.

收录时间: 2018-11-18
分类: SQL Server
贡献者: Rector
224 热度

How to Write a Better T-SQL Code

Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are aimed for the beginner-level T-SQL developers.Always Use a Schema for the Program...

收录时间: 2018-11-18
分类: SQL Server
贡献者: Rector
234 热度

SQL Server support for TLS 1.2 - Read This First!

In January 2016, Microsoft announced that TLS 1.2 would now be supported in specific builds of SQL Server 2008, 2008 R2, 2012, and 2014. Personally, I was pleasantly surprised to see this support back-ported to 2008 and 2008 R2; I was convinced that those customers would just be urged to upgrade if TLS coverage was that important to them. So this is great news.

收录时间: 2018-11-18
分类: SQL Server
贡献者: Rector
343 热度

What’s new in SQL Server 2017

Posted on August 15, 2018by Prashanth JayaramSQL Server 2017 is considered a major release in the history of the SQL Server life cycle for various reasons. From my personal point of view, SQL Server 2...

收录时间: 2018-08-17
分类: SQL Server
贡献者: Rector
287 热度

Top things you need in a SQL Server performance monitoring tool (from deadlocks monitoring to alerting and index monitoring)

The initial article, Top things you need in a SQL Server performance monitoring tool (from performance metrics to wait statistic and query performance monitoring) covers the most important “things” that any DBA expects to find in an SQL Server performance monitoring application and how those are covered in ApexSQL Monitor. This sequel will cover another set of critical and essential information that any successful SQL Server performance monitoring tool should be able to monitor and present in a manner that is easy to understand and interpret, and how those are covered in ApexSQL Monitor

收录时间: 2018-08-17
分类: SQL Server
贡献者: Rector
311 热度

Mining Plans : Not just for the plan cache

Mining Plans : Not just for the plan cacheAugust 16, 2018 by Erin Stellatoin SentryOne, SQL Plan| No CommentsSentryOne eBooksIn these books, you will find useful, hand-picked articles that will help g...

收录时间: 2018-08-17
分类: SQL Server
贡献者: Rector
306 热度

SQL Server Generate Database Script

This post is showing you how to generate the scripts for all the database structure in a SQL Server. You can right click the database in SQL Server Management Studio for sure but in that way you can only generate the scripts for one database at a time. Using the code below you are able to generate all the database at one time.

收录时间: 2018-08-13
分类: SQL Server
贡献者: Rector
AD 友情赞助
386 热度

sql server 索引阐述系列五 索引参数与碎片

使用Filefactor可以对索引的每个叶子分页存储保留一些空间。对于聚集索引,叶级别包含了数据,使用Filefactor来控制表的保留空间,通过预留的空间,避免了新的数据按顺序插入时,需腾出空位而进行分页分隔。   Filefactor设置生效注意,只有在创建索引时才会根据已经存在的数据决定预留的空间大小,如里需要可以alter index重建索引并重置原来指定的Filefactor值。   在创建索引时,如果不指定Filefactor,就采用默认值0 也就是填充满,可通过sp_configure 来配置全局实例。Filefactor也只就用于叶子级分页上。如果要在中间层控制索引分页,可以通过指定pad_index选项来实现.该选择会通知到索引上所有层次使用相同的Filefactor。Pad_index也只有索引在新建或重建时有用。

收录时间: 2018-07-26
分类: SQL Server
贡献者: Rector
381 热度

SQL解析在美团点评中是如何应用的?

数据库作为核心的基础组件,是需要重点保护的对象。任何一个线上的不慎操作,都有可能给数据库带来严重的故障,从而给业务造成巨大的损失。为了避免这种损失,一般会在管理上下功夫。比如为研发人员制定数据库开发规范;新上线的SQL,需要DBA进行审核;维护操作需要经过领导审批等等。而且如果希望能够有效地管理这些措施,需要有效的数据库培训,还需要DBA细心的进行SQL审核。很多中小型创业公司,可以通过设定规范、进行培训、完善审核流程来管理数据库。

收录时间: 2018-07-17
分类: SQL Server
贡献者: Rector
304 热度

Obtaining recursive data with sql server

I am trying to get recursive data. Following code returns all parents on the top and then the children. I would like to get data Parent 1 – his children then parent 2 - his children then parent3 – his children. How do I do this?

收录时间: 2018-07-17
分类: SQL Server
贡献者: Rector
349 热度

SQL Server中锁与事务隔离级别

已持有共享锁否是SQL Server中可以锁定的资源包括:RID或键(行)、页、对象(如表)、数据库等等。在试图修改数据(增删改)时,事务会请求数据资源的一个排它锁而不考虑事务的隔离级别。排它锁直到事务结束才会解除。对于单语句事务,语句执行完毕该事物就结束了;对于多语句事务,执行完COMMIT TRAN或者ROLLBACK TRAN命令才意味着事务的结束。在事务持有排它锁期间,其它事务不能...

收录时间: 2018-07-16
分类: SQL Server
贡献者: Rector
336 热度

Top things you need in a SQL Server query plan analysis tool

SQL Server query plans AKA execution plans are one of the greatest assets when it comes to tuning, optimizing, and troubleshooting our queries. Transact-SQL is a declarative language that can be used to query data without requiring a human interaction to specify an exact execution plan to be followed. This simply means that we are not telling SQL Server how to go and fetch the data, we’re just telling it what data we want it to get. So, think of an execution plan as a map. It is a map that the query optimizer is drawing that represents an efficient execution plan to retrieve the data.

收录时间: 2018-07-15
分类: SQL Server
贡献者: Rector
AD 友情赞助