.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

cross database chaining with system views

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :
 

Hi,

I have a stored procedure owned by DBO on a Database that is accessing some system views on Master. Those views are owned by SYS, so in this case, execution privileges given on DB1 to the SP Owned by DBO do not take advantage from the cross database chaining.

How can I have users able to execute such SP on DB1 without granting them explicity permissions on the system views that are on Master?

Thanks in advance,

Regards,

Sérgio




View Complete Post


More Related Resource Links

Security problem with cross database chaining and stored procedures

  
I have a situation whereby ProcA exists on database A, but ProcA executes about 20 stored procedures scattered across different databases. To further complicate matters some procs that ProcA calls also call other procs in other databases, this then presents the problem of cross database chaining where you can’t really write to a database from a proc that resides in another database. I am wondering how I can get around this problem, I know I can simply let open cross database chaining and the problem will go away, the other option is to create a proxy which is very complicated and wouldn’t work in my environment. Is there any way around the problem.

Access Database from another system..

  
I am using SqlExpress 2008, I have created a instance named "INSTANCEA" in one system as windows authontification mode and sql server authentification mode..  Its working well... But I can't access my instance from another system... while accessing the instance i have got the following message.... Cannot connect to NODEA\INSTANCEA. ------------------------------ ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 28 - Server doesn't support requested protocol) (Microsoft SQL Server, Error: -1)

Hide system database in SQL Management Studio

  
I am using SQL server 2008 . What i all want is to create a uses that can only see the ABCDatabase in Management studio onced login. And to achieve that:1- I have created a new user.2- Deny View all database right to that user.3-Set that user as Owner of ABCDatabaseNow on login that user cannot see other databases but still able to see the system databases. How can i hide those system databases from that user?

need a simple login page cus my hosting provider system wont allow me to have more than one database

  
I dont really write html code too well  but I manged to get my web site developed and deployed using the built in features such as drag n drop, master page and user account authentication that make web developing almost a codeless experience. However; my hosting provider system wont allow me to have more than one database, this causes problems becasue when I developed my web app using vb2010 web developer (asp.net v2) I used the built in web config tool to manage users for my site, now after I deployed to my domain it all worked ok with the exeption of the login page, when I tried to log in the system threw a error message saying "database not found." or a page of "gobble-dee-gook" that says the same thing When I contacted support (my hosting provider) they said i have to create a table of users in my database file via 2008 sql server, thats ok I can do that, but my real problem is I dont know how to write appropriate code to reference the table. So heres my problem:  I just want to have some kind of login page with a couple of txtboxes and a click button that maybe using the VB code behind or html checks the input variables "username" "password" against something that is hard coded into vb a string variable or a constant and then branches to Mainmenu.aspx if successfull. I just need it real simple, no fancy stuff just a login s

what is the better design for location of system database data / log files and user data/log file,

  
is there a guideline for better performance for system database data location log location, like tempdb location etc. also better location for user databases/data and log.

How To Update Database When The System Shut Down By Light Problem

  
Hi,I want to update the User LoggedIn Status to 'False', when the system shut down by light problem, or when the user click the 'Browser Close Button'Please help me in details.Thanks in advance.

Unhandled exception in XAML editor from control that accesses database. - "System.Data.SqlServerCe.S

  

Hello,

Im having a bit of difficulty with some WPF/C#/SQL Server CE code.

I have a WPF User Control with the following line of code in the constructor:

MyDatabase database = new
 MyDatabase("Data Source=|DataDirectory|\\MyDatabase.sdf"
 );

where MyDatabase is a class generated using SQLMetal.exe from MyDatabase.sdf.

 

When I added this control to other controls, the application runs fine and I'm able to access my database. When I try to edit these parent controls,  the XAML editor throws the following error:

 

>System.Data.SqlServerCe.SqlCeException
>The database file cannot be found. Check the path to the database. [ Data Source = D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MyDatabase.sdf ]

 

Why does the XAML editor redirect my DataDirectory to "D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\" and why does the XAML editor execute my database access code?

 

How can I fix this so I can use this control in a XAML editor?

Thanks,

Greg S.

 


Unhandled exception in XAML editor from control that accesses database. - "System.Data.SqlServerCe.S

  

Hello,

Im having a bit of difficulty with some WPF/C#/SQL Server CE code.

I have a WPF User Control with the following line of code in the constructor:

MyDatabase database = new
 MyDatabase("Data Source=|DataDirectory|\\MyDatabase.sdf"
 );

where MyDatabase is a class generated using SQLMetal.exe from MyDatabase.sdf.

 

When I added this control to other controls, the application runs fine and I'm able to access my database. When I try to edit these parent controls,  the XAML editor throws the following error:

 

>System.Data.SqlServerCe.SqlCeException
>The database file cannot be found. Check the path to the database. [ Data Source = D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MyDatabase.sdf ]

 

Why does the XAML editor redirect my DataDirectory to "D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\" and why does the XAML editor execute my database access code?

 

How can I fix this so I can use this control in a XAML editor?

Thanks,

Greg S.

 


How to identify a system database

  

Hi,

please can you help me how to 100% identify system database by T-SQL? Please not by the name. I think, there has to be any official way. Thanks.


Michal Neuwirth | personal developer blog (CZ) | blog on Kentico Devnet(EN)

System.IO.Compression from Device to Database to Service

  

Hi,

I have a Windows Mobile Forms application that uses the System.IO.Compression DeflateStream class to Compress a bitmap image of a signature, which it does well compressing from ~86kB to ~6kB.

Once compressed, the byte array is written to a SQL CE Database (into an Image datatype column), which is later transferred to a staging database via MS Sync Framework.

Once in the staging database, I have a Windows Service which will read the signature data, decompress it and turn it back into a bitmap.

Unfortunately, when I try to decompress the byte array, I get the following exception "Index was outside the bounds of the array.".

Before I introduced Compression, this system worked 100%.

Now, I've tested in the Client (Windows Mobile) application that I can compress the Image to a byte array, then decompress the byte array back to an image and that works. Also, I have the same Compress/Decompress helper methods in the Client and Server applications.

I'm wondering where the problem lies; Is there a difference between the Compact Framework 3.5 and .NET Framework 3.5 implementations of DeflateStream that renders them incompatible? Or is there some issue with writing a compressed Byte Array to an Image column in a table and reading it back?

Here is the code for my Compress/Decompress helper methods:

How did they link directly to views in the Bugs Database Template?

  

I just created a site using the SharePoint Bug Database Template.  I would like to know how, in the Quick Launch, they are able to link directly to pages that display different views of the bugs list.  My understanding is that the only way to do this would be to create a blank .aspx page, and drop a web part on it that shows the list, then in modifying the web part, tell it what view to display.  I did this in another site I built.

However, in the Bugs site, I don't see any indication that it was done that way.  When looking at All Site Content I don't see a list of web pages (with the webpart) that display these views.  Also, the modify webpart drop down arrow is not visible on any of the pages.

Was this done in a different way on this site template?  I'd be grateful if anyone could tell me how it was done, so that I might use that method next time around.


There are no mistakes; every result tells you something of value about what your are trying to accomplish.

Regarding backup of database to public ip system from local system

  

Hi,

how to take backup of database from local system to public ip system?

Database on local system..

that backup file should be on that public ip system..

Please help me ASAP

Thanks in advance.


backup database to a different system

  

Hi Team,

how to take a backup to a disk which is not that server like to global shared path..

can we give as \\sysname\...

Thanks,

Eshwar

 

 


Cross database object dependency in SQL Server 2000

  
Is there a way to figure out cross database object dependency in sql server 2000? (for ex: finding all the objects that a view refers which may reside in the same or different database)

Restore database from system dbs and log file when .mdf file size set to 0KB after Windows Update ?

  

This can't be right. Friday I tried to install some Windows updates including ‘Security Update for …Windows Server 2008 for x64-based Systems (KB2416473)’ on both my host Server 2008 box and on a VM instance of Server 2008 running on the same physical box. An important SQL Server 2008 instance lives on that VM.

 

The above mentioned update failed on both the host and the VM, but a system shutdown and reboot were required for both OS’s anyway. When SQL Server started up again on the VM, the *.MDF file size for 2 (out of maybe 15 total) databases had been reduced to 0KB. Additionally, 1 of accompanying *.LDF files was now also 0KB in size, while the other *.LDF file was probably its normal size of 2.9GB. All the other databases and log files, including Master.mdf, seem to be okay.

 

I’m new to SQL Server and have a couple of questions of cours

System Database Location

  

I've done some research on this, but honestly really can't find an absolutely hands down compelling reason for locating the system databases off the c: drive where the OS resides.

In my environment

  1. Space on c: drive is not an issue.
  2. I don't find navigating through the file system to system databases ( and log files) a big deal or cumbersome.
  3. As I understand it, these system databases ( with perhaps the exception being temp) don't really get much use, are not "write and or read" intensive, say as compared to "User" databases. 

So moving them to another physical disk with better performance characteristics doesn't seem to make much sense to me, and or worth the trouble to be perfectly honest.

using System.Reflection to saving to database

  

Hello guy!

 

I am having challenges saving multiple row to my database using reflection. Each time I cmd.ExecuteNonQuery(), I get the message 'The variable name '@referenceID' has already been declared. Variable names must be unique within a query batch or stored procedure.'

What should i do to resolve this?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend