Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Browsing all 3160 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Get Your SQL Server Product Key with Powershell #dbatools

There are lots of tasks that are easily accomplished with bot h PowerShell and T-SQL. Get-SqlServerKey is a command that will find your product keys. It’s not often you might need this, but it’s a pain...

View Article


Migration from SQL Server to Azure SQL Database Using Transactional Replication

Written by: Josh Gnanayutham, Program Manager, SQL Engineering Introduction As users are increasingly moving their data to the Azure cloud, migration from SQL Server to Azure SQL Database is a common...

View Article


Image may be NSFW.
Clik here to view.

SQL SERVER Database Mirroring Connection Error 4 An Error Occurred While R ...

I was trying to set up database mirroring in my freshly created Azure Virtual Machines and encountered an error. The error was talking about the connectivity problem, but it was something else. Let us...

View Article

Image may be NSFW.
Clik here to view.

【SQL Server】面对具体的业务场景,该选择临时表还是表变量?本文为你详细解读

摘要 通过前面的三篇系列文章,我们对临时表和表变量的概念、对比和认知误区已经有了非常全面的认识。其实,我们的终极目的,还是今天要讨论的话题,即当我们面对具体的业务场景的时候,该选择临时表还是表变量? 几种典型场景 以下是几种典型的场景,让我们看看到底该作何选择,以及做出最终选择的具体原因和考量。 存储过程嵌套 在SQL...

View Article

Deprecated SQL Server Data Access Technologies

I hope the warning excerpt below from the SQL Server Books Online is not a surprise to you (emphasis mine): Warning: SQL Server Native Client (SNAC) is not supported beyond SQL Server 2012 . Avoid...

View Article


Image may be NSFW.
Clik here to view.

How to Enable Auto Update Statistics and Auto Create Statistics with T-SQL In...

Question:How to Enable Auto Update Statistics and Auto Create Statistics? Answer:I have received this question after watching my free webinar on group by conference by one of the user. I really loved...

View Article

Image may be NSFW.
Clik here to view.

SQL SERVER Database mirroring connection error 4 An error occurred while r ...

I was trying to set up database mirroring in my freshly created Azure Virtual Machines and encountered an error. The error was talking about the connectivity problem, but it was something else. Let us...

View Article

Image may be NSFW.
Clik here to view.

Getting Started with SSRS 2016 - Part 2

Prerequisite We should have some basic knowledge in SQL Server Query and Visual Studio Tool for creating an SSRS Reports using Visual Studio 2015. SQL Server Basic Query Visual Studio 2015 How to...

View Article


pl/SQL编程(五)参照变量 SQL SQL语句 SQL编程 参照变量

pl/SQL编程(五)参照变量。参照变量用于存放数值指针的变量,通过使用参照变量可以使应用程序共享相同对象,从而降低占用的空间可以使用游标变量(ref cursor)和对象类型变量(ref obj_type)两种参照变量使用游标时,当定义游标不需要指定相应的select语句,但是当使用游标时(open时)需要指定select语句实例如下:1.编写pl/sql块...

View Article


解决SQLServer导入数据,错误0xc02020f4x sql SQLServer SQL导入数据 错误0xc02020f4x

解决SQLServer导入数据,错误0xc02020f4x。用txt文件或csv文件, 向sqlserver导入数据出现错误。 错误信息如下: 错误 0xc02020f4: 数据流任务 1: 由于为列0指定了多个代码页(65001 和 936),无法处理此列 自己试了下,这种错误一般发生在把带中文的数据导入数据库的时候。 这里65001和936应该是编码格式,65001...

View Article

Javaweb开发后台使用sql查询效率问题 sql SQLServer sql查询效率问题 Javaweb

Javaweb开发后台使用sql查询效率问题。今天在项目中遇到了一个不算是问题的问题 后台查询地区时sql是这样的String sql="select * from area_info_table where id in ("+ "select area_id from showroom_info_table where id in("+ "select showroom_id from...

View Article

SQL执行setidentity_inserton错误8106 sql SQLServer setidentity inserton 错误8106

SQL执行setidentity_inserton错误8106。SET IDENTITY_INSERT [TABLENAME] {ON|OFF}从字面的意思看是用来在插入主键时设置主键状态的。这个主键指的是自增长的主键。2.2使用方法2.2.1首先,这条语句只对自增长的主键生效,经过在查询分析器上的试验,如果主键不为自增长类型会报如下错误:服务器: 消息 8106,级别 16,状态 1,行 1表...

View Article

SQL性能优化 sql SQL数据库 SQL性能优化

SQL性能优化。(1)选择最有效率的表名顺序(只在基于规则的优化器中有效)ORACLE 的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句中写在最后的表(基础表 driving table)将被最先处理,在FROM子句中包含多个表的情况下,你必须选择记录条数最少的表作为基础表。如果有3个以上的表连接查询, 那就需要选择交叉表(intersection table)作为基础表,...

View Article


Image may be NSFW.
Clik here to view.

NavicatPremium还原SqlSever数据(MDF及LDF格式) sql SQLServer SqlSever数据 数据还 ...

NavicatPremium还原SqlSever数据(MDF及LDF格式)。 1.还原.mdf格式数据库文件 1.新建SQL server连接 2.执行查询语句 exec sp_attach_db '数据库名','E:\A.mdf','E:\A_log.ldf' 2.使用客户端进行备份还原(.bak数据库文件) 实际上也看到了备份过程中执行的sql 语句,粘贴如下:BACKUP DATABASE...

View Article

学习SQLite基础笔记 sql SQLServer SQLite基础

简介SQLite 是一个关系型数据库管理系统,是 SQL(结构化查询语言)的实现,是 Android OS 配套的 C++ 库,使得应用可以拥有私有数据库。SQL 可用来创建、搜索和维护数据库。下载安装:下载以及安装教程 利用CMD命令提示符跳转到自己的保存数据库的文件夹,使用“sqlte3 数据库名字.db”创建新的数据库文件C:\Users\12045>cd...

View Article


T-SQL语句(一)――数据库操作 SQL SQL语句 SQL数据库 数据库操作

T-SQL 语句(一)—— 数据库操作 一、创建数据库CREATE DATEABASE testON( NAME = 'test_db', -- 数据库名称 FILENAME = 'D:\db\test_db.mdf', -- 数据库主文件存储位置 SIZE = 5MB,-- 初始大小 MAXSIZE = 10MB,-- 最大大小 FILEGROWTH = 5% --增长速度),( NAME =...

View Article

Image may be NSFW.
Clik here to view.

Resolving the Maximum Request Length Exceeded Exception in SQL Server...

By:Dallas Snider || Related Tips: > Reporting Services Development Problem When deploying a report in SQL Server Reporting Services, I am receiving an exception error stating "Maximum request...

View Article


Not Quite Monday Morning SQL Break February 7, 2017

It’s Tuesday and time to get Monday’s weekly blog and twitter round-up for last week out the door. It’s late and I need to find a better way to ensure that I get this out the published. If you haven’t...

View Article

Get cumulative update number for SQL Server Version

Question:I’m trying to find the latest sql cumulative update on a SQL Server. I’ve read the post SQL Server Get SQL Server Version ( SQL Server DBA) and have extracted the details. How can I tell from...

View Article

Image may be NSFW.
Clik here to view.

Retail customer analytics with SQL Server R Services

In the hyper-competitive retail industry, intelligence aboutyour customers is key.You need to be able to find the right customers, understand what types of customers you have, and know how to keep the...

View Article
Browsing all 3160 articles
Browse latest View live