|
Hello,
This is Vikash.
I have an application where on starting the application it connects to SQL Server 2000.
At this point of connection I also execute the query 'Select Name From Sysdatabases' to get a list of database names.
The problem is at my PC using My SQL Server 2000, the Query is getting executed properly giving me a list of databases.
But when I install the software on one of the clients PC where my database is attached to their existing MSSQL Server 2000, it display the error message, "Invalid Object Name 'sysdatabases'".
Can somebody tell me why this is happening. Has somebody faced similar problems.
Please any help would be highly appreciated.
Thanks in Advance.
|
|
|
|
|
Check the permissions of your connection credentials. Typically a developer assigns himself god rights to their database and lose sight of the fact that a DBA will never do that on a production server.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the reply Mycroft.
but can you tell me what credentials you are talking about.
My Connection string is :
Server=<Servername>;Database=<DBname>;Uid=<UserID>;Pwd=<Password>;
what else do I need to provide.
Is It That Sysdatabases will work only if I have access rights to all the databases in the instance.
bcoz, my client also has several other databases in this instance which I am connecting and I might not have rights to those databases.
Awaiting your reply.
|
|
|
|
|
sysdatabases lives in the master database, your credentials may not have rights to that database.
You probably need to arrange r/o access for those credentials to the master database or event the sysdatabase table if that is the only table you need.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Have you tried prepending 'sys.' to it.
eg. select * from sys.sysdatabases?
Regards,
Rob Philpott.
|
|
|
|
|
Hi Folks,
I have a ASP.NET Web intranet application that allows users to access tables and add, modify,view, or delete records. The tables, stored procedures are present in SQL 2005 on Windows 2003.
Each of my client boxes has SQL Server Management Studio. The authentication mode is Windows. What I want is any user other than administrator should not have permission to change data through back-end.
The real question is he should be able to change data only through the front-end application. If he accesses database from the Management Studio he should not be allowed to alter tables and stored procedures. My main concern is would denying permissions on tables in back-end affect the functionality of adding, modifying, and deleting data through front-end.
Please help me out.
Regards,
V1i9n6o7d
|
|
|
|
|
It is far simpler than locking down tables, though any lock down is user specfic so it won't effect your web application if done correctly.
On the database holding the back-end for your app, only add the administrator, and the website execution account as having access to the database. If you want to be doubly sure then lock down that entire SQL instance to just those two users so that no-one else can get in and add themselves.
Don't forget to add yourself though, or you won't be able to maintain the database when they ask for the enevitable changes.
|
|
|
|
|
What is the Web execution account
|
|
|
|
|
Each application runs under some credentials. The ASP.NET application runs on a different user-account than the one that you use to log into your Windows machine. This is done to enhance security - the application doesn't need all those permissions that you have.
The builtin ASP.NET[^] account is the one that runs the application. Alternatively, you could switch your database to use "SQL Server authentication[^]".
I are Troll
|
|
|
|
|
v1i9n6o7d wrote: My main concern is would denying permissions on tables in back-end affect the functionality of adding, modifying, and deleting data through front-end.
Yes of course it will. You need to formulate another strategy or refine you current one. Personally I use SQL standard credentials when my app connects to the database and give the AD connections read only access.
You may be able to lock down read only by credential/app, I know profiler is aware of the application so it may be there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can anyone help me in understanding Locking and Transaction in SQL Server?
|
|
|
|
|
Lots of information can be found here[^]
|
|
|
|
|
I would like to detect if SQL Server is 'doing anything'. I know this is vague so a bit of background:
I have a GUI that starts a long set SQL server processes (its a financial model), and in order to overcome the extremely cack network we have, I start this SQL process via a SQL agent job, so that the 'server' owns the process rather than the user running the GUI.
Now I've got control logic in the sql, updating timestamps in tables etc, but I would like a 'backup' to this.
Originally I thought about using the sql server cpu activity which I can get via WMI, and some kinda of threshold value...so if cpu >33% then the server is likely to working and not idling?
But I just wondered if there was a better way?
I'm using SQL Server 2000 and VB6 (yea you can laugh!)
|
|
|
|
|
|
Hi all,
Can any one tell me how to delete the data from the database.
Thanks in advance.
|
|
|
|
|
Whatever database you are using, it must be having a delete command. Use it.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
i want to delete by using the query.
|
|
|
|
|
Why can't you google or use the help provided with database? This is so very trivial. Anyways, here you go (assuming you are using MS SQL):
Delete from tableName where [whatever condition you want to use]
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
If you don't even know how to use help, should you even consider doing a delete? Unless you know what you are doing you can lose more data than expected.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I don't know your specific requirement, but I am giving certain situations. Let me know in case of any concern
General syntax:
DELETE FROM
{table name | view name}
[WHERE search_conditions]
Note: Where clause is optional
Case 1: Delete all rows from the table
Delete from tablename
Case 2: Delete based on a condition(Suppose I want to delete those employees from Employee table whose salaries are more than 50k)
Delete from Employees
where Salaries > 50000
Case 3: If you want to drop your table issue
DROP TABLE table_name
Case 4: Though you have not asked, but if incase you need to truncate your table issue :
Truncate Table table_name
Case 5: If you want to delete duplicate records like
Input:
id name
1 name1
10 name1
2 name2
3 name3
11 name3
4 name4
Output:
id name
1 name1
2 name2
3 name3
4 name4
Query:
delete from tblname where id in
(
select id
from(select ROW_NUMBER() over(partition by name order by name) rn,
Id, name from tblname)X
where rn <> 1
)
But your question title is
sarang_k wrote: delete the data from the database
Case 6:
If that is suppose to be the case, the I presume you want to drop the database (:(don't know why?)
However, the command is
Drop DataBase database_name
For more information please look into Deleting Data from an SQL Table
Hope this helps
Niladri Biswas
|
|
|
|
|
|
Mycroft Holmes wrote: When he comes back with "I can't truncate the table", you can try explaining foreign keys
Or Cascade.
|
|
|
|
|
Hi!
I need to connect remote mysql server and get the data. But I could not succeed it. I use reel IP address as serverIpAddress
MySqlConnection CN = new MySqlConnection("server=serverIPaddress;Port=3306; user=root; password=test; database=dbtest;");
Also I update my nat table to forward connections. But I get this error
A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Could you help me on this issue?
|
|
|
|
|
|
Yes. I have searched but I could not overcome this problem. It is not related with the string that I use. It is totaly about configuration settings on mysql.
|
|
|
|