表示 进入内容 14
Displaying posts with tag: MSSQL (reset)
SQL Server 优化器内幕【上篇】

我记得我还在上一家公司的时候,有一次和主管一起做1:1,主管问我,将来你的技术方向是什么,我说我想往HA方向发展,因为是我的强项。主管问我还有别的吗?我犹豫地说,我也想做优化器方向,但是智商不够。主管大笑,说如果有兴趣可以钻研看看。

【数据存储与数据库】  【算法】  【mysql】  【RDS】  【SQL】  【数据库】   …

[获取更多]
Stored Procedure In MSSQL

A stored procedure is a group of Transact-SQL statements compiled into a single execution plan.

Creating A Stored Procedure

Here is a sample example for us, it includes create method and delete method:

USE pubs
IF EXISTS (SELECT name FROM sysobjects
         WHERE name = 'au_test' AND TYPE = 'P')
   DROP PROCEDURE au_test
GO
CREATE PROCEDURE au_test
@StudentId INT
@Name VARCHAR(100) OUTPUT
AS
SELECT Name FROM students WHERE id = @StudentId
GO

The OUTPUT variable must be defined during the table creation as well as during use of the variable. OUTPUT cursor parameters are used to pass a cursor that is local to a stored procedure back to the calling batch, stored procedure, or trigger.
System stored procedures are created and stored in the master database and have the sp_prefix. If any user-created stored procedure has the same name as a system stored procedure, …

[获取更多]
Connection To SQL Server

Connection To SQL Server

How to use C# to connect to the SQL Server, there is a connection string we can use:

      string conn = "Integrated Security=false; Data Source=****;Initial Catalog=****;User ID=****;Password=****";

Data Source (Server; Address ; Addr ; Network Address): The name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name:
server=tcp:servername, portnumber
When specifying a local instance, always use (local).
Initial Catalog (Database): The name of the database.
Integrated Security (Trusted_Connection): By default, it is false, and User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication.

To ensure that connections are always closed, open the …

[获取更多]
SQL Server安装权限问题

最近想重拾一下SQL技术,可是发现我工作机里的SQL不好使,我个人账户没有权限创建新的DB,很是郁闷,想了好久可能是我用另外一个admin账户安装的,恰巧密码也想不到了。sa的账户也无法使用,可能在安装时只设置了windows验证,没有设置成混合模式。唉,真是太悲催了。这个案例也许不很常见,可是让我遇到了,现在的处境是卸也卸载不了,使用也没法正常使用。我做了几步尝试,觉得值得把它们记录下来:

如何确定身份验证模式

如果不能确定如何验证 MSDE 安装的身份验证模式,可以查看相应的注册表项。默认情况下,对于 Windows 身份验证,Windows LoginMode 注册表子项的值设置为 1。如果启用了混合模式身份验证,则此值为 2。

•LoginMode 子项的位置取决于您是将 MSDE 作为默认 MSDE …

[获取更多]
表示 进入内容 14