Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Thursday, October 29, 2015

SQL Server: Save changes is not permitted. Resolution

Save changes is not permitted. The changes you have made require the following tables to be dropped and recreated. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

User canceled out of save dialog.

Solution:

  • Go to Tools > Options

  • Go to Designers > Table and Database Designers
  • Uncheck the Prevent saving changes that require the table recreation.

Friday, October 16, 2015

SQL: Stored Procedure vs Function - Difference

Following are the difference between sql stored procedures and sql functions

Stored Procedure Functions
Can return 0 or multiple values Function must return a value
SP can call functions Functions can not call SPs
Allow SELECT + DML(INSERT/UPDATE/DELETE) Allow SELECT operation only
Cant not be used in SELECT statements Can be used in SELECT statements
Cant not be used in WHERE/HAVING clause  Can be used in WHERE/HAVING clause
SPs can have INPUT and/or OUTPUT parameters Functions can have input parameters only
This is a precompiled set of statements, hence Compile statements everytime.
Transactions can be created in SPs Transactions can not be created
Allow TRY CATCH blocks Does not allow exception handling