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


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

How to identify a system database

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :Sql Server
 

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)


View Complete Post


More Related Resource Links

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.

 


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:

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

 

 


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?


Getting server non system databases, getting database tables, getting table columns

  

I use next code to get server databases

string connectionString = "Data Source=DENIS\\SQLEXPRESS;Integrated Security=SSPI;";
DataTable tables = new DataTable("Tables");
using (SqlConnection connection =
    new SqlConnection(connectionString))
{
  SqlCommand command = connection.CreateCommand();
  command.CommandText = "sp_databases"; 
  command.CommandType = CommandType.StoredProcedure;
  connection.Open();
  tables.Load(command.ExecuteReader(CommandBehavior.CloseConnection));

}

this.dataGridView1.DataSource = tables;

I've got many databases :

- model ( i guess it is system )

- master ( i guess it is system )

- tempdb ( i guess it is system )

- db1 ( my table )

and etc.

How to determinate what table is system.

http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/

SELECT *

FROM information_schema.Tables

So how to determinate what table is system or not.

Can I get tables of database

Database creation for System Center Operations Manager 2007

  
I want to install System Center Operations Manager, and create the database in SQL Server 2008 R2 that is hosted on a different server, the problem is telling me that the version of SQL does not match the version that SCOM needed.
I tried putting SP1 and SQL 2008 SP2 to R2, but not let me.
It says that "The version of the instance of SQL Server Shared Component does not match the version expected by the SQL Server. The version of SQL Server product is installed 10.50.1600.1 and awaited version of SQL Server is 10.0.1600.22. "
I think it's the version of SQL.

Marta

backup of database in public network system

  

hi

i have to take backup of database in public network system..

that backup file should be in my system..i.e local network system.

share folder is not accessing..

so is there any other way?


cross database chaining with system views

  

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


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