Quantcast
Channel: Chanmingman's Blog
Viewing all articles
Browse latest Browse all 1943

Run Insert, Update, or Delete without commit in SSMS

$
0
0

This post shows to how to Run Insert, Update, or Delete without commit in SQL Server Management Studio.

In some cases you do not want to actually delete or update the rows rather you want to see how many rows will be affected by your Insert or Delete statement. This is the good time for you to set in SQL Server Management Studio. There no such word like Auto Commit in the Tools, Options so don’t look for one. What you need to do is like that following.

1. Open SSMS

2. From the Menu bar, select Tools –> Options

3. Select Query Execution –> SQL Server –> ANSI

4. Click the check box SET IMPLICIT_TRANSACTIONS

5. Click on OK


For example, you issue the SQL command Insert
INTO Products
(ProductName, CategoryID,UnitPrice)
VALUES (‘Server’, 1, 4000000)


When you exit then SSMS will ask you “Do you wish to commit these transaction before chlosing the window?””


Reference:

https://suneethasdiary.wordpress.com/tag/disabling-auto-commit-mode-in-sql-server-management-studio/


Viewing all articles
Browse latest Browse all 1943

Latest Images

Trending Articles



Latest Images