Click here to Skip to main content
15,908,444 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
CREATE PROCEDURE CustomerAddress_UPDATE
  
		@CustomerId		BIGINT,
		@HouseNo		NVARCHAR(100),
		@StreetAddress1	NVARCHAR(100),
		@StreetAddress2	NVARCHAR(100),
		@Town			NVARCHAR(100),
		@County			NVARCHAR(100),
		@PostCode		NVARCHAR(100)		
	AS
	
  UPDATE [dbo].[Customer] 
  SET propertyName=@HouseNo,
	  streetAddress=@StreetAddress1,
	  streetAddress2=@StreetAddress2,
	  town=@Town,
	  county=@County,
	  postcode=@PostCode
  WHERE customerID=@CustomerId


I am getting this error:

SQL
Msg 262, Level 14, State 1, Procedure CustomerAddress_UPDATE, Line 12
CREATE PROCEDURE permission denied in database 'master'.
Posted
Updated 17-Jul-13 21:52pm
v2
Comments
Zoltán Zörgő 18-Jul-13 3:53am    
Don't shout (don't use all caps)!
Maciej Los 18-Jul-13 3:54am    
Don't SHOUT! Using only capital letters is treated as abuse.
NETIQUETTE[^]
Alok.singh1166 18-Jul-13 4:27am    
okay

Well, the error message is quite clear: you don't have the permission to alter the ddl of this database. Connect with a user having proper permissions.
Google is your friend:
http://menononnet.wordpress.com/2011/03/07/create-database-permission-denied-in-database-master-microsoft-sql-server-error-262/[^]
http://blogs.msdn.com/b/dparys/archive/2009/09/17/create-database-permission-denied-in-database-master-my-fix.aspx[^]
 
Share this answer
 
Comments
Maciej Los 18-Jul-13 4:29am    
+5!
Adarsh chauhan 18-Jul-13 4:44am    
+5
add below sql to top of the your script

SQL
use [Your database name] 
 
Share this answer
 
v2
Comments
Maciej Los 18-Jul-13 4:30am    
Too fast for me ;)
+5!
select the db name properly @left side of sql server,set your database name.
Else send some other details
 
Share this answer
 
Check your permission to the database. Before you start execute query to create new stored procedure, you need to define destination database. You can do it, using reserved word: USE.

SQL
USE YourDatabaseName;
GO

CREATE PROCEDURE CustomerAddress_UPDATE
--the body of SP
 
Share this answer
 
Comments
Shanalal Kasim 18-Jul-13 6:59am    
+5
Maciej Los 18-Jul-13 7:11am    
You're welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900