I have created a sql login account called "webuser" and has given public role in my database. In my asp.net application i build connection string using above account and its password . We give permission on store procedure for for the above account to execute .We dont give table level permission for the above account . When we run the application with the above settings it runs fine on test server . However Now i have transfered the databse object to live server with its permissions . Now while I executing the aspx page , I am getting above error . I have checked that the store procedure has execute permission for webuser account and dbo(i.e SA) has all the permissions for all database objects . Still why i am getting error ? (Please note , the thing is working fine in test server)
There is a database with 200 tables for owned by userA and another 200 similar tables owned by another userB. How can I drop all the tables owned by userA in a transaction by querying on system table. I need the syntax giving the name of the system table etc.Any help is highly appreciated. Thanks!
I have a few questions about SQL 7.0 user permission.
(1) Is there any way that a DB user (not sa) can create a table whose owner is dbo? I tried to set the user as a member of db_owner, but the table still had the user's name instead of dbo.
(2) What does it mean to have the sysusers.isaliased column with value 1 for a DB user? Such username always shows up with prefix "". How can I set a DB user this way?
Although I am in the DBO role, whenever I create an object I am put in as the object owner. For the way our database is set up, all of our objects are owned by DBO, and it can be a pain to have to remember to set the owner when creating an object. In 6.5, if you were aliased as dbo, all objects you created were owned by dbo. This is the functionality I'm looking for.
Is there any way to have dbo be the default owner of an object when it is created? Again, I am in the dbo role.
We have SQL2000 and generally each user uses Windows authentication for their Enterprise Manager connections. When developers create tables, I would like them all to show DBO as the owner (DBO.TABLEA), not JOE.TABLEA.
I'm probably forgetting something basic, but right now I'm stumped.We are moving a database to a new server. bcp'd out the loginaccounts and bcp'd them into the new server. Restored the databasebackup and everything was working fine yesterday testing out theapplication -- this is a 3rd party application, not an in-house appand database.Today, the application server can't start. The log file shows that itdoesn't see a table. I recognize the table as one of the tables notowned by dbo (3rd party, not my doing). I double check the value ofsysxlogins.sid and sysusers.sid, and sysusers.uid and sysobjects.uidand everything matches ok.If I log into Query Analyzer as the application user and select fromthe table, I see the same error. If I use ownername.tablename whereownername is the same as the login name I am using, then it worksfine. It's like SQL Server isn't recognizing the account as being thesame as the object owner.I ran sp_changeobjectowner to change ownership to dbo and then ran itagain to change it back to the application account, and it still actslike the object owner is not the object owner.The quick solution was to change all objects to be owned by dbo -- Ichecked with the vendor to make sure they didn't have any objections.But I really would like to figure out why it was happening.Has anyone had this problem? And, if so, did you know what I'mmissing?ThanksTeresa
Using SQL Server 7.0Trying to change an objects ownership to dbo withEXEC sp_changeobjectowner 'AssignInvoiceNumbers', 'dbo'which gives the following error:Server: Msg 15001, Level 16, State 1, Procedure sp_changeobjectowner,Line 26AssignInvoiceNumbers does not exist.which it does.Any help would be greatly appreciated--Nath(Email mangling obvious)*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
Hi there,We have a user name convention here that specifies users in thefollowing way:jane.doejohn.smithIn order to change a database object I must specify the owner name alongwith the object name. Does anyone know the proper syntax for doing thiswith a user name that contains a period? When I put the user namefollowed by the object name in quotes such as 'jane.doe.tb_test_table',SQL Server can not find the object.Any help is appreciated.Kelly
User bob has create procedure permission as follows:
grant create procedure to bob
bob would like to create a procedure in schema Accounts.
When he issues create proc Accounts.sp_proc.... it fails with:
Msg 2760, Level 16, State 1, Procedure sp_proc, Line 3 The specified schema name "Accounts" either does not exist or you do not have permission to use it.
What permission do I need to grant bob in order to allow this?
I have SQL Server 2005 database, and have linked it with three SQL Server 2000 databases, and using Windows Authentication.
I'm using ASP.NET with my main database (SQL Native Client), which is authenticating to the linked databases with the computer hostname (DOMAINCOMPUTER$) credential, which is all working fine on all databases for doing SELECT queries.
However, now I'm trying to run a stored procedure on the linked databases. Two of the three databases are working flawlessly in this regard, but the third I'm getting the error: EXECUTE permission denied... I've checked the logs, and it's showing the connection as being trusted, and I've already added the execute permission for the stored procedure in question, but I'm not getting anywhere.
I have restarted the database server, but that hasn't helped any.
I tried all the INFORMATION_SCHEMA on SQL 2000 andI see that the system tables hold pretty much everything I aminterested in: Objects names (columns, functions, stored procedures, ...)stored procedure statements in syscomments table.My questions are:If you script your whole database everything you end up havingin the text sql scripts, are those also located in the system tables?That means i could simply read those system tables to get any informationI would normally look in the sql script files?Can i quickly generate a SQL statement of all the indexes on my database?I read many places that Microsoftsays not to modify anything in those tables and not query them since theirstructure might change in future SQL versions.Is it safe to use and rely the system tables?I basically want to do at least fetching of information i want from thesystem tables rather than the SQL script files.I also want to know if it's pretty safe for me to make changes in thesetables.Can i rename an object name for example an Index name, a Stored Procedurename?Can i add a new column in the syscolumns table for a user table?Thank you
hi,I use DataGrid in name UserTable.I use this code: SqlCon.Open() UserTable.DataSource = SqlCom.ExecuteReader(System.Data.CommandBehavior.CloseConnection) UserTable.DataBind()and i get this error: EXECUTE permission denied on object 'Test', database 'DI', owner 'dbo'I craete stored prcedure in name Test with the simple SQL code:CREATE PROCEDURE [dbo].[Test] ASselect Users.*from UsersGOIf instead i put the SQL code : select Users.* from Usersin my command as a text i get the error : SELECT permission denied on object 'Users', database 'DI', owner 'dbo'i have already create a local premmision for my DB & tables as MYMACHINE/ASPNETHow i can solve this problem?Thanks, Moshe
Hi!I have a problem. i have created a website with a login page, i have moved all my aspnetdb tables to my remote host. but when iam trying to logon i get this error messages. EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database 'dbname', owner 'dbo'. Someone? I really need help...
I just installed this application on my new server and I get this error for each object in the database including the tables and the stored procedures. I have been going in for each one and opening the properties and then going to permissions and making the changes for each one. Is there a way to do this for the entire database at once? Thanks
I want to send email using sql stored procedure.my code is work fine in my local sqlserver account. when I use my online sql server it display this error. EXECUTE permission denied on object 'sp_OACreate', database 'master', owner 'dbo'. EXECUTE permission denied on object 'sp_OASetProperty', database 'master', owner 'dbo'. EXECUTE permission denied on object 'sp_OAMethod', database 'master', owner 'dbo'. EXECUTE permission denied on object 'sp_OADestroy', database 'master', owner 'dbo'. How canI solove this problem?
I want to send email using sql stored procedure.my code is work fine in my local sqlserver account. when I use my online sql server it display this error.
EXECUTE permission denied on object 'sp_OACreate', database 'master', owner 'dbo'.
EXECUTE permission denied on object 'sp_OASetProperty', database 'master', owner 'dbo'.
EXECUTE permission denied on object 'sp_OAMethod', database 'master', owner 'dbo'.
EXECUTE permission denied on object 'sp_OADestroy', database 'master', owner 'dbo'.
I am having this issue with my application developed in VB.Net. The thing was working properly for the last couple of years. But suddenly it is giving me this error message when ever I try to execute the following code.
mycommand = New SqlCommand(sqlstr, SqlConnection1)
SqlConnection1.Open()
mycommand.ExecuteReader()
The operation is never related to sending e-mail and even the master Database, it is used just to display records on grid.
Here is the error message comeing out when it reaches the mycommand.ExecuteReader():
EXECUTE permission denied on object 'xp_startmail', database 'master', owner 'dbo'.
When I am trying to drop a user using following statement
--First remove access from all databases Set @SQL = ' USE [?]; if ''' + @login_name + ''' in (Select name from sysusers ) EXEC [?].dbo.sp_revokedbaccess @name_in_db = N''' + @login_name + '''; ' Exec sp_msforeachdb @SQL Print 'Access Removed.'
User has been dropped from current database. User has been dropped from current database. Access Removed. No permission to access database 'model'. Server: Msg 229, Level 14, State 5, Line 1 SELECT permission denied on object 'sysjobs', database 'msdb', owner 'dbo'.
Login dropped.
The SQL Version I am using is ------------------------------------------- Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
I'm trying to identify the objects in master that the role public has select permissions on, but when I run this query, I get 4 results where the default schema is null and the major_id column does not correspond to any records in the sys.all_objects table. Where else can I look to find what objects these are. DBO is listed as the grantor.
I appreciate your help.
SELECT * FROM SYS.DATABASE_PERMISSIONS P, SYS.DATABASE_PRINCIPALS R WHERE P.GRANTEE_PRINCIPAL_ID=R.PRINCIPAL_ID and permission_name='SELECT' and class_desc='OBJECT_OR_COLUMN' and r.name='public' order by r.name desc
Hi, I wanted find the log information if anybody deleted my database or bojects in my server. Is it possible we can able to find this details in my previous log or any sys tables ? Thanks
I got an error that says to run DBCC CHECKTABLE, but I can't find what table it is. It gives the db id and page Id. I ran DBCC PAGE but I could not figure out what object is using that page. I posted the error and dbcc page results below. Also, Slot 74 is not missing. I could not find m_objId or AllocUnitId in any system tables . Also, I got the same error for this db several other times. When I ran dbcc checkdb I did not get any errors. This is a SQL 2012 db created by SharePoint.
Why is m_nextPage and m_prevPage = (0:0) ?
Does the m_type=3 change how a page is linked?
I found Type 3 – text mix page. A text page that holds small chunks of LOB values plus internal parts of text tree. These can be shared between LOB values in the same partition of an index or heap.
Error2 from log-- Message The Database ID 7, Page (1:14002), slot 74 for LOB data type node does not exist. This is usually caused by transactions that can read uncommitted data on a data page. Run DBCC CHECKTABLE.
I'm trying to run an Insert on tables using a User Login but I keep getting the error above. I ran the insert using my own credentials and it worked. The User LOGIN in question has read & write permission to the database.
I try to implement mirroring using certificate authentication. When I do this query :
create certificate Principal_cert with subject = 'Principal certificate', start_date = '2007/11/01', expiry_date = '2020/11/01'; GO
Create endpoint endpoint_Princ state = started
as tcp(listener_port = 7024, listener_ip = all)
for database_mirroring (authentication=certificate Principal_cert, encryption = disabled, role = all);
GO
I have this error :
Msg 1088, Level 15, State 1, Line 1
Cannot find the object "Principal_cert" because it does not exist or you do not have permissions.
I have also noticed that the error does not occured when I try this in the master database.
So, I have two questions:
1. Why SQL server does not find a certificate that just been created ? 2. Should the certificate be in the master database or in the database being mirrored ?
Why don't you folks (SQL SERVER Management Studio Team or SQL SERVER Database Engine Team) provide an option by using which I would be in a position to know what all the other objects are depended on a selected object and vice versa. That means:
When I select a Table within the SQL SERVER Management Studio if there is an option for understanding "Which all the objects (tables or views) it is depended on (I mean Foreign key and etc... kind of relations) and also Which all the objects (Tables, Views, Stored Procedures and etc...) are using this table", It would be of great help for all developers.
I can't find 'SQL Server: SSIS Pipeline' performance object in performance monitor on a 64-bit SQL Server. I see it on a 32-bit. Does anybody know why?
Hi There,This is related to a ms access database but since I use the SqlDataSource control I thought I should post here.I have a project that I was working on with this ms access db and using sql controls, everything was working just finesince one day I started getting "Object reference not set to an instance of an object" messages when I try to designa query or retrieve a schema, nothing works at design time anymore but at runtime everything is perfect, its a lotof work for me now to create columns,schemas and everything manually, I've tried reinstalling visualstudio, ado componentsbut nothing seems to fix it, did this ever happen to any of you guys?any tip is really appreciated thanks a lot
Does any one has any clue for this error ? I did went through a lot of articles on this error but none helped . I am working in Visual studie 2005 and trying to upload image in sql database through a simple form. Here is the code
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using System.Web.Configuration; using System.IO; public partial class Binary_frmUpload : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e) { }protected void btnUpload_Click(object sender, EventArgs e) {if (FileUpload.HasFile == false) { // No file uploaded!lblUploadDetails.Text = "Please first select a file to upload..."; } else {string str1 = FileUpload.PostedFile.FileName; string str2 = FileUpload.PostedFile.ContentType; string connectionString = WebConfigurationManager.ConnectionStrings["GSGA"].ConnectionString; //Initialize SQL Server Connection SqlConnection con = new SqlConnection(connectionString); //Set insert query string qry = "insert into Officers (Picture,PictureType ,PicttureTitle) values(@ImageData, @PictureType, @PictureTitle)"; //Initialize SqlCommand object for insert. SqlCommand cmd = new SqlCommand(qry, con); //We are passing Original Image Path and Image byte data as sql parameters. cmd.Parameters.Add(new SqlParameter("@PictureTitle", str1)); cmd.Parameters.Add(new SqlParameter("@PictureType", str2));Stream imgStream = FileUpload.PostedFile.InputStream; int imgLen = FileUpload.PostedFile.ContentLength;byte[] ImageBytes = new byte[imgLen]; cmd.Parameters.Add(new SqlParameter("@ImageData", ImageBytes)); //Open connection and execute insert query. con.Open(); cmd.ExecuteNonQuery(); con.Close(); //Close form and return to list or images.
} } }
Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 32: Line 33: string str2 = FileUpload.PostedFile.ContentType; Line 34: string connectionString = WebConfigurationManager.ConnectionStrings["GSGA"].ConnectionString; Line 35: Line 36: //Initialize SQL Server Connection Source File: c:UsersManojDocumentsVisual Studio 2005WebSitesGSGABinaryfrmUpload.aspx.cs Line: 34 Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] Binary_frmUpload.btnUpload_Click(Object sender, EventArgs e) in c:UsersManojDocumentsVisual Studio 2005WebSitesGSGABinaryfrmUpload.aspx.cs:34 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Not sure if this is the right forum to post this question to, so if it's not, please accept my apologies.
I'm working in SQL Server 2005 with a database that was migrated to 2005 from SQL Server 2000. I have to alter a trigger on a table for some functionality changes, and when I modify the trigger and then access it through the application the database is working with, I receive this error:
There was a error in the [stored procedure name] procedure. Error Number: -2147217900 Error Description: [Microsoft][ODBC SQL Server Driver][SQL Server]The definition of object '[trigger name]' has changed since it was compiled.
[stored procedure name] and [trigger name] are where the actual names appear in the message.
I've tried running sp_recompile on the trigger, stored procedure, and table that are associated with this, and nothing works. I have dropped the trigger, which allows the save process to complete (but doesn't perform the required functionality, of course), and then re-created the trigger, but the error message still comes up. The compatibility level for the database is SQL Server 2000 (80) (as it was migrated from SQL Server 2000 as I mentioned above).
Has anyone seen this, and if so, how can I fix it?