Posts Tagged ‘SQL Server’

Difference between delete and truncate

Delete: Whenever we are using delete from tablename, then automatically deleted data internally stored in buffer. We can get it back by using rollback command.

Windows could not start the sql server on local computer

Generally we receive the following error message when we tried to start the SQL server. Windows could not start the SQL Server (MSSQLSERVER) on Local Computer. Error 1069: The service did not start due to a logon failure

Adventureworks database installation in sql server 2014

Adventureworks database is sample database sql server. Until 2012, Microsoft provided sample databases are in the format of mdf and ldf file downloads, we have to download and attach the mdf and ldf file to install Adventure works 2008/2008 R2/2012. This has changed completely in 2014. Download Adventureworks database from codeplex site. Adventureworks database installation […]

How to change the database owner in SQL Server

Who creates the database is the owner of the database. We can change the owner of the database using either sp_changedbowner or ALTER AUTHORIZATION. When we create a database, a row created in sys.databases.It stores information like database owner, creation date, size.. We can find out the database owner name either by using T-SQL query […]

SQL Server Shortcuts

Following are most useful SQL Server Shortcuts. Shortcut Description SSMS To Open SQL Server Management Studio Ctrl+N To open new query window in current connection Ctrl+Shift+N Open Project Ctrl+O Open File Ctrl+Shift+O Open Project Ctrl+S To save the currently query window with sql extension Ctrl+R To show/Hide the results Pane

Restore master database in SQL Server

If master database is damaged or unusable, then we have to restore the master database. We can restore the database in two scenarios. 1. If server is accessible: step1: Put the server in single user mode add -m to the startup parameters in the sql server service using the configuration manager and restart the server […]

Start SQL Server in single user mode

Single User mode in SQL Server can connect with single user only and did not start checkpoint process. We have to start SQL Server in single user mode, when issues are like master Database restore, Sysadmin locked out etc,.. Process is very simple. This is three step process. 1) Open SQL Server COnfiguration Manager by […]

How to create database in SQL Server

Database is collection of objects like tables, stored procedures, Views, Functions, Synonyms, etc. There are two ways to create the database in sql server. 1. GUI(graphical user interface) and 2. T-SQL script. Create database using GUI Mode: Open SQL Server Management Studio–>Object explorer–>Select the databases folder –> right click –> click on new database as […]

nosql vs sql databases differences

Following are major differences between NoSql and Sql databases NoSQL Database SQL Databases Open Source databases Mixed(Open source and closed source) Different types including key-value stores, document databases, wide-column stores, and graph databases One type (SQL database) with minor variations Examples: MongoDB, HBase, Cassandra, Neo4j Oracle, PostgreSQL, MySQL, Microsoft SQL Server, Sybase

Difference between migrate and upgrade

Of course we have upgrade adviser but that will be useful if we have existing SQL Server. But whether we should upgrade or migrate that decision should be taken by us. Each one has their own pros and cons. Migrate: This process involves installing a new SQL instance & then migrating each database to new […]

Powered by k2schools