MSSQL 2005 User Database Now Shows Up In System Database Folder
Dec 10, 2007
While attempting to set up sql replication in MSSQL 2005 one of my user databases is now in the systems database folder. I need to move it back to the user databases folder. Any help would be greatly appreciated.
I m using mssql server 2005, when i create a user account for mssql and then use this account to login via management studio. It will show all the system databases and other client databases. How can i hide those databases and allow the client to see their own databases.
I am using SQL Server Express Edition 2005 as a backend database working with Visual Basic 2005.
I am using Vista and having two users to access to my computer. User-1 and User-2.
I created a database in User-1 and works fine Visual Basic 2005.
Now the problem is when i login to my computer system with User-2. I cannot able to access the database with encountering error like "User-1/SQLExpress". I know that i cannot able to access to database which was created in User-1.
Do you any solution to this problem. when i login with user-1 and user-2 it should able to access database.
My question takes two parts; firstly, is the new table that I'm proposing going to handle the business logic I describe below, and secondly, if I put the new table in, how in hell do I use it?
Right; present schema attached.
The idea, which I hope is fairly clear from the schema, is that you send it a buch of parameters about the event, admission date, etc, and it will return all tickets matching those parameters. An example stored proc for this is below:
CREATE PROCEDURE [dbo].[getSingleTicketsByParameters] @eventIdINT, @standIdINT, @admissionDateIdINT, @bookingDateIdINT, @concessionIdINT, @bookingMinQuantityIdINT, @bookingMaxQuantityIdINT, @membershipIdINT AS SET NOCOUNT ON SELECT [tblTickets].[id], [tblTickets].[booking_date_id], [tblTickets].[booking_min_quantity_id], [tblTickets].[booking_max_quantity_id], [tblTickets].[ticket_concession_id], [tblTickets].[membership_id], [tblTickets].[event_id], [tblTickets].[stand_id], [tblTickets].[admission_date_id], [tblTickets].[price], [tblTickets].[availability], [tblTickets].[description], [tblTickets].[admin_description], [tblTickets].[ticket_open], [tblTickets].[ticket_live], [tblEvents].[event_name], [tblEvents].[event_open], [tblStands].[stand_name], [tblStands].[stand_open], [tblBookingDates].[booking_start_date], [tblBookingDates].[booking_end_date], [tblTicketConcessions].[concession_name], [tblBookingMinQuantities].[booking_quantity], [tblBookingMaxQuantities].[booking_quantity], [tblAdmissionDates].[description], [tblAdmissionDates].[admission_start_date], [tblAdmissionDates].[admission_end_date], [tblAdmissionDates].[date_open], [tblMemberships].[membership_name] FROM [tblTickets] LEFT JOIN [tblEvents] ON [tblEvents].[id] = [tblTickets].[event_id] LEFT JOIN [tblStands] ON [tblStands].[id] = [tblTickets].[stand_id] LEFT JOIN [tblBookingDates] ON [tblBookingDates].[id] = [tblTickets].[booking_date_id] LEFT JOIN [tblTicketConcessions] ON [tblTicketConcessions].[id] = [tblTickets].[ticket_concession_id] LEFT JOIN [tblBookingQuantities] AS tblBookingMinQuantities ON [tblBookingMinQuantities].[id] = [tblTickets].[booking_min_quantity_id] LEFT JOIN [tblBookingQuantities] AS tblBookingMaxQuantities ON [tblBookingMaxQuantities].[id] = [tblTickets].[booking_max_quantity_id] LEFT JOIN [tblAdmissionDates] ON [tblAdmissionDates].[id] = [tblTickets].[admission_date_id] LEFT JOIN [tblMemberships] ON [tblMemberships].[id] = [tblTickets].[membership_id] WHERE 1=1 AND ([tblEvents].[id]=@eventId OR @eventId=0) AND ([tblStands].[id]=@standId OR @standId=0) AND ([tblTicketConcessions].[id]=@concessionId OR @concessionId=0) AND ([tblAdmissionDates].[id]=@admissionDateId OR @admissionDateId=0) AND ([tblBookingDates].[id]=@bookingDateId OR @bookingDateId=0) AND ([tblBookingMinQuantities].[id]=@bookingMinQuantityId OR @bookingMinQuantityId=0) AND ([tblBookingMaxQuantities].[id]=@bookingMaxQuantityId OR @bookingMaxQuantityId=0) AND ([tblMemberships].[id]=@membershipId OR @membershipId=0) GO
So. It's all about to get horribly, horribly complex (well, it is to me) so take a deep breath.
Tickets are subject to quotas. However, quotas are subject to... well, at the moment they can be based on event, stand, admission date, concession, or any combination of these. They can also be based on an individual ticket. All quotas, however, are annual; they only apply to ticket purchases in the same year. For example: - you can't buy more than 4 tickets for date A, in stand B at event C, per year. - you can't buy more than 2 tickets for stand D per year. - you can't buy more than 4 of ticket number 123.
Now, I'm thinking that all I need to manage this is one table, and it's going to look a little like this:
tblQuotas id INT PK ticket_id INT FK event_id INT FK stand_id INT FK admission_date_id INT FK quota INT
So, if I put a record in there with an event, stand and admission date - and a quota - then I've met the first business rule that I described above. If I put in a record with just a stand id and a quota, then I've met the second sort. If I put in one with just a ticket id and a quota, then I've met the third.
Now we return to that big SQL statement above. The one that says "get me all eligible tickets that match these parameters". And it's got to get a lot bigger because I now need to not only join in tblQuotas, to see if any quotas apply to the ticket I've chosen (or to the event, stand, etc that make it up), but I've also got to join in tblBasket, and tblOrders, and tblUsers, to find out how much of any particular quota they've already used up in previous orders. Although that's only orders placed in the current year, mind. And of course I also now haveto pass the users ID in as a parameter so I can look up their order history.
Your head's hurting too, right?
So... this is where I've got to:
SELECT SUM(ticket_quantity) FROM [tblBasket] INNER JOIN [tblTickets] ON [tblBasket].[ticket_id] = [tblTickets].[id] INNER JOIN [tblOrders] ON [tblBasket].[order_id] = [tblOrders].[id] WHERE [tblTickets].[stand_id] = @standId AND [tblOrders].[user_id] = @userId AND ([tblOrders].[order_date] BETWEEN '2006/01/01' AND '2006/12/31')
What I want to do is incorporate that into the big SQL query up top, in such a way to make it only return tickets that not only match the ticket parameters but that also aren't linked to stands, admission dates or anything else, that the user has reached their quota on.
Oh, and I'm in a bit of a hurry so do try and get a move on won't you? ;)
But seriously - how do I put those two SQL querys together? Do I need one for each paramater that might have a quota attached, or is there a quicker way? All suggestions and advice, up to and including "get an easier job, dude", received gratefully :)
On my VWD 2005 Express, I have installed 2 SQL Server 2005 Express databases in the App_Data folder.I kind of remember these 2 databases were installed from Wrox web site or a zip file. Now we still useSQL Server 2000 databases for our ASP.net applications. I have downloaded the SQL Server 2005 Express.These 2 databases in the App_Data folder seem to work fine although I can not see them from theManagement Studio Express. My question is: How do I 'manually' create a new SQL Server 2005 database into the App_Data folder? TIA,Jeffrey
How would I set permission for SQL Server 2005 "User A" to prevent access to System and other user databases, also How to hide the databases that "User A" has no rights to. I mean, when User A logs in, All other user databases are not visible to him/her.
I've made af site in Visual Web Developer. On that site i've made a database and it worked finde when I first uploaded it to my FTP as a database file on the server. But due to security problems, my web hotel host has deactivated that possibility. Så now I have to put my data and tables into the MSSQL 2005 Database the host uses. Now here's the problem.
1: How do I do that?
2: How do I get tha tables I've made i Visual Web Developer over in SQL Server Management Studio Express så that I can upload it?
I have system database and user database file are present in G,H and W drive.The process is going to be - copy data from G to S, H to T, W to U. Rename G to X, H to Y and W to Z. Rename S to G, T to H and U to W. Reboot the servers. The original G, H and W will then be X, Y and Z. The old S will be the new G, old T will be H and old U will be W. My question is that after doing this whether my SQL server will start or not
Hello, im shure this must have been up before and i apologize for that. But i wonder if there is a way to convert the SQL server express databases to MSSQL 2005 databses?
Hi all, I have read/studied (i) Working with Databases in Visual Web Developer 2005 Express in http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/vwd.aspx, (ii) Xcopy Deployment (SQL Server Express) in http://msdn2.microsoft.com/en-us/library/ms165716.aspx, (iii) User Instances for Non-Administrators in http://msdn2.microsoft.com/en-us/library/ms143684.aspx, and (iv) Embedding SQL Server Server Express in Applications in http://msdn2.microsoft.com/en-us/library/ms165660.aspx. I do not understand the concepts and procedures to do Xcopy and User Instances for non-administrators completely-I do not know how to connect to databases and create database diagrams or schemas using the Database Explorer. I have a stand-alone Windows XP Pro PC. I have created a ChemDatabase with 3 dbo tables in the SQL Server Management Studio of my SQL Server Express and a website of my VWD Express application with an App_Data folder. I am not able to proceed to use Xcopy and user instance to bring the 3 dbo tables of ChemDatabase to my App_Data folder. Please help and give me some detailed procedures/instructions to bring the 3 dbo tables of ChemDatabase (or ChemDatabase itself) from the SQL Server Management Studio Express to the App_Data folder of the website of my VWD Express project? Thanks in advance, Scott Chang
Hello, How do you copy all stored procedures into a .sql file using Microsoft SQL server management studio?I am trying to make a database installation file that should have all the tables and SP in it, can't find away to copy that information to a .sql file.
I'm running 2000 databases in a 2005 server. Can anyone tell me if there are adverse effects in doing this? As I understand it, the 2005 performance benefits are available to databases running as 2000(Ver80) But some of the new futures may not be available.. And any documentation from Microsoft/white papapers regarding this subjects are appreciated..
While working with SQL server 2005, as there is new resouce database which is hidden read only. According to books online we should be backing up that database as NTFS file backup (i.e. .exe file). In what type of secnario that we need Resource database required for SQL 2005 system recovery? Do we really need to backup this file and how often?
Hello all,i'm moving all my development to the new 2005/Fw2 environment.Now, i have an MSSQL 2005 server on the development server. To restore an existing database, i've created a new database with MSSQL 2000 compatibility level, and i've restored the backup over it. Everything seems ok, but when i try to create a diagram, i get the following error message:"Database diagram support objects cannot be installed because the database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects."I've checked the properties and there seems to be the right owner (sa). If i create a new database with 2005 compatibility level, everithing works fine.Where is the problem?Also, a side question: by setting compatibility level to 2000, is it correct that the database can be deployed to a 2000 Server environment with no problems?Thanks in advance for any advice. -LV
Iam reading this forum from some time but its my first post here
Today i found by accictend this really nice PDF poster with SQL 2005 internal System Tables and thought that maybe someone here will be interested having it.
Poster is really huge, just like db schema on it ;)
But ok no more words, just grab it from here if You want http://rapidshare.com/files/79265626/sql.2005.sys.tables.pdf
Regards, Tom
PS. 1. If You can't read PDF after download with FireFox (like me) turn off pdf plugin and then download starts normally 2. If someone from admins think that its not good forum for this post pleas move it to somewhere that it best fits.
I am not so familiar with SQL Server 2005, but the problem is that when i created a vies and try to save it, instead of the name starting with the dbo. prefix, its starting with my username.
And i just found out that this is not happening only in the view its happening where ever i created an object and try to save it.
How can i change this from my username to make it display dbo. instead.
I think this is why i'm getting permission error when i try to use DTS package.
Hi, I am zeronet. I decide to set up our own web system application just like Ebay. Because of the low investment, I want to select a free DB for our data storage. For high performance, we want to set up a distributed db system. As a beginner of SQL server 2005 express, we want to know: if the SQL-server-2005-express has that ability to manage large amout data and to do with this work? I am eager to hear of your advice. Thanks. yours zeronet
We have a Prinicipal, a Mirror and a Witness server. We have automatic failover configured between the Prinicipal and Mirrored server. When we stop MMSQL service on Prinicipal, not all the databases failover to the Mirrored instance. Any suggestions would be welcomed as we have a tight deadline to get this in Production.
i was planning to create a database migration tool .. its a certain database of a DMS (document management system) to another DMS (two different DMS)... from DMS using msde 2000 server .. and tranfer to a DMS using a postgre sql or mssql .. depends ..
they have different table structures and names . . :D
i was thing of what language shall i use.. or what language is the best to work on this kind of project :)
I am new to ms SQL. I only have the use of the Enterprise Manager. Creating tables I understand. However I am confused on how to add data to a table or view the data in a table. Can this be done through Enterprise Manager? If I am adding a large amount of data do I have to use the query window. This seems like a tedious method. In Access yo have a form basically pop up where you can type in the record sets. Any advice would be appreciated! Sincerely, Bill Bequette
I have a database that resides in SQL Server 7.0 that I can attach in Microsoft's SQL Server Management Studio Express and I can see all the tables from the database in that program.
My problem is that when ever I re open SQL Server Enterprise manager, the database that I attached to SSME, shows up as Database(Suspect). Now I am unable to view my tables in that database. Can anyone tell me what causes this, and how I can resolve that issue?
I need to have my sql server database, and sql server express edition database present in SSME because I am doing an import of data from SQL Server 7.0 to SQL server express.
Also, if there is another easier way to import data from SQL Server 7.0 to SQL Express edition, I would like to know...
I had 3 questions regarding system SPs in SQLServer2008:
1. Does "stored procedures are documented in SQL Server Books Online" in System Stored Procedures (Transact-SQL) have a special meaning or it means that these system SPs have documentation while the others don't?
2. Why the system SPs listed in MSDN are less than the actual ones in SQLServer2008?
3. Is there a list that shows which system SPs are most used?
We're currently undertaking the development of our first SQL Server 2005 database and we've stumbled across a problem with our method of deployment from Development through System Test, UAT and, finally, to Production.
Under SQL Server 2000 we would build a new database in Development and assign permissions to a specific database user which was linked to an appropriate Windows Login - the whole build process was scripted. We would then hand the mdf and ldf files over to the Operations team who would attach the database to the System Test server, create a new Windows Login (appropriate for the environment), then run a script which would update the SID stored against the database user to the SID of the appropriate login.
e.g.
Database user (consistent through all environments) = AppDAL
Development: Windows Login = DOMAINAppDEVDAL
System Test: Windows Login = DOMAINAppSYSDAL
UAT: Windows Login = DOMAINAppUATDAL
Production: Windows Login = DOMAINAppLIVEDAL
The script, which directly updates the dbo.sysusers table in SQL 2000, links the AppDAL user to the appropriate Windows Login.
Is there any way to perform this task under SQL Server 2005? I'm aware of the sp_change_users_login stored proc, however this only works for SQL Server logins and not Windows logins. Also I'm aware that direct updates to system tables are not allowed under SQL Server 2005 and were not recommended under SQL Server 2000 so we were actually using an unsupported method during deployment. My guess is that we will have to change our method of deployment and rely on the Operations team to build the database in each enviroment from scripts, however I was wondering if there is another way before we go ahead.
Interestingly SQL Server 2005's sp_change_users_login stored proc contains SQL that does not run outside of the stored proc:
Would any body be able to suggest the best way switch a Lotus .nsf file to Ms SQL database or even to an Access?
I have a .nsh file that I am able to see the contents of but not the database structure, and rather then rebuilding the database and manually inserting the content I would like to import all the information from an old .nsf file that appears to have restriction on it.