Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Tuesday, 9 August 2016

How to Fix 'int' is not a recognized CURSOR option Error ?

The following example simulate the  'int' is not a recognized CURSOR option error.



We declare the int variable without using '@' Symbol. For all variable declaration we need to use the @ symbol as prefix to avoid the above error.


In above example we declared int variable so that the error is showing as int is not recognized. In case if you declare float variable the error will be
'float' is not a recognized CURSOR option

Friday, 8 July 2016

Error Code : 18456 Login Failed for User in SQL server ?

The following error will occur while connecting the SQL server using windows authentication.



The root cause for above error is the user account has been disabled.
We need to enable the user account by login in to system administrator (Sa) account as shown below.

Go to Security --> Logins --> Select the user account ,right click the account and select properties.



The Login properties will be displayed as shown below.



In the above properties the permission is denied and login is disabled.
Grant the permission and enable the login as shown below.


Once done click OK button and you can login with the user account.

Sunday, 3 July 2016

Failed to Update Database , because the database is Read-Only.

The update statement will be failed due to the Read only mode of the database.
To resolve the error please follow the below steps.

Change the Database Read only to Normal Mode.

Please Refer the replication of the error in the below image.



You can see the database color is changed to grey color and in bracket it is marked as Read only.



Change the database mode using below T-SQL statement as shown below.


Once executed successfully yon can refresh the database and found the database is coming back to normal mode as shown below.


After changed to Read Write mode, you can execute the update statement and it will be updated successfully as shown below.



Steps to change the Mode of the database to read only

Execute the below T-SQL statement.



You can noticed that the database mode has been changed to Read-Only mode as shown below.


How to resolve the connection error in SQL server ?

"Network related or instance specific error occurred while establishing a connection to the SQL server".

I believe that most of the developers faced the following issue while connecting the SQL server.



To resolve the above error please follow the below steps.

Go to SQL server configuration manager using Start -- > SQL server configuration Manager.
After opening the Configuration manager, select the SQL server instance as shown below.

You can see that the SQL service has been stopped and this is the root cause for the error.Right click the instance and select Start option.


Now the SQL service is preparing to start as shown below.





Once started you can see that the SQL service is running now.



Now if you try to connect the SQL server instance the server instance will be connected successfully as shown below.




The permanent fix for the above error is to set the startup type of the SQL service instance as Automatic.So that the service will be started automatically once you logged in the system.