I have a database that contains a few tables such as person, staff, member, and supporter. The person table contains information about every staff, member, and supporter. The information it contains is name,address,email, and telephone. I also created an id that is the primary key. My issue is that I also have an primary key ID for staff, member, and supporter.
For instance, in the person table is John with id 1.He is a supporter so in the supporter table is pID(for person id)to reference back to John with all his information and ID(for supporter ID).pID references to the person table and every person has an ID incremented by 1 starting at 1. supporter ID is for every supporter and also starts at 1 and is incremented by 1.
Is it possible to have in the supporter table pID = 1 and supporter ID = 1? Another person may have a pID = 26 and supporter ID = 5. Or will supporter ID have to be different than the pID and be something like "sup"? So you would have pID = 1 and supporter ID = sup1 or pID = 26 and supporter ID = sup5
I'm trying to create a database that takes specific information from a number of databases on different servers to make some reporting that we have much easier.
I'm pretty new to SQL so I'm not sure of the best way to proceed. I read an article that suggested I use the OPENROWSET command. The problem is, the version of SQL that came with one of the programmes we use is limited and will not allow you to turn on the allow "Ad Hoc distributed Queries" so the SLQ statement will not execute.
I'm confused why it won't let me to connect through ODBC as I've created a web page that selects data from this database with no problems!
Here is the SQL statement that I've written to make sure it is the correct one (on the msdn library page it said that this was the ODBC connection):
SELECT a.* FROM OPENROWSET('MSDASQL','DRIVER=(SQL Server);SERVER=APPOLOACT7;UID=sa;PWD=***************', 'SELECT * FROM MDCTestAndDev.dbo.TBL_CONTACT') AS a
I've also created the ODBC connection using the tool on Administration Tools>Data Sources ODBC
Any help would be greatly appreciated (also any ways of selecting from one database and inserting it into another will be helpfull)
Using SQL Server Express 2005, I have two databases. AppDB - The main application database.GeoDB - A somewhat static ZIP code / states / other geographic stuff databaseI need to have some foreign key columns in tables in AppDB reference columns in the GeoDB database tables. Eventually other application database besides AppDB will be doing the same thing in our infrastructure. After googling and reading for days, here is what I think I know:You cannot create foreign keys that reference tables in another database in SQL Server.You cannot create foreign keys that reference columns in a view, and you definitely cannot make an index on a view that has base tables in another database.You can create a trigger that references tables in another database, but this can be flaky? (nested/recursive trigger problem).SQLServer 2005 supports multiple schemas within the same database. Maybe I should logically separate my databases this way? Seems like it would be a tough solution to manage since I already have some databases live in production that will eventually use this 'static' GeoDB. Also, seems like it wouldn't be as portable as keeping the GeoDB info in its own database, but maybe I'm being too software engineer-ish here - afraid of low cohesion, high coupling.I will greatly appreciate any advice I can get, or any more options I am missing. Thanks,Adam Nofsingerucnmedia.com
Hi All, I am designing database where few of the master tables will reside in different database or in case different server. Scenario is Server "A" with Database "A" may host the "Accounts" table. Server "B" with Database "B" may host the "Product" table. I am designing database "Project" which will hosted in Server "A". My application requires this master tables [readonly access] as data inserted in my application refers this tables. Also there are reports to be generated which refer this tables. How do i design my database and sql queries? I am thinking of approach of having equivalent tables created in my database and writing service which keep tables in my database in sync. This will ensure good perfomance during transaction and reports as they will need to refer this table locally as opposed to different database or different server.
Any thoughts on above approach?? or any better/standard way for such scenarios ?
Thanks in Advance. Your inputs will be of great help.
Online US Searchable Map of the 50 US States. Users search criteria is the following: Query records by selecting state, county, then record. Each County table has 10-20 tables. All databases combined = 500MB and TLogs = 100MB.
How would you re-design a relational DB where users could query data by state-county-record. Currenty the DB's are created by the County of each state which creates hundreds of DB's in SQLServer with no realtionship to each US state. What would be the best design to ensure good performance, data integrity and maintenance? Would you create 1 DB with all 50 states, create 4 DB's and divide by region(N,S,E,W), 50 DB's of each state or leave it as is with each county it's on DB? Any suggestions would be appreciated.
I have a SQL Server 2005 Express database that was designed to be used by one client. What is the best way to change the design so it can contain multiple clients that can only see data entered by users of each client organization? Also I'm using the asp.net membership database to handle login and profiles. Can this be used with my multi client database?
hi all~i very confuse~i using mssqlserver 2005 in visual basic 2005express..but i feel like want to update two table at onces..i faced some problem~i give an example..my tableA got user id, user name and table B got user id and status.In both table, i put user id as primary key and it will auto link each other and i retrieve the user id and user name from table A and user status from table B~..in order to come out the data in gridview with three columns which are user id, user name and user status..in this case, it works perfectly..but when come to update part, i only able to update one table at once, when i trying to update both table, it occurs errors...i did read some forum, some said it is impossible to do it?isn't?then is dere got any other ways to make me update both table at once?my purpose of this is wish to update user id and user name from table A and user status on table B....~i guess maybe my database design concept got problem..hope someone giv help on these... by the way izit foreign key can solve this?and how to put the foregin key?
Hello EveryoneI am in the process of creating a web application that will allow me to have one place to go to see all of my SQL Databases. I would like to have one of the pages that showed the current status, or maybe next to the name of the server, have the status listed.I know how to create a database connection string using the web.config But I will need to have a query that loops thru a list of database server names, and each of them returning the status. Being able to connect, query the status of the server, show the status of each database. My database connection string will only log into one database. How can I code this to be able to loop thru the list of stored database server names, and then be able to log into each database server?Can I use a separate class with a method, and pass in the name of the server? That means that I would have to have the same user name on all the database servers, wouldn't I ?I am looking for a way to accomplish this. I am open to suggestions. I am coding my web app using C#. ThanksAndrew SQLDBA
I am planning to develop reports using reporting services. My reports will use data from 3 different SQL Server databases that are application specific on three different cpu's. I'm planning on having a reporting database that is a common repository for data extraction / summarization from the other 3 databases.
I'm trying to understand the best way to approach my design (it's been a while since I've done database work - pretty obvious...):
Use Analysis Services to move the data from the three databases to the reporting database server.
Create some stored procedures that can do this.
I'm not seeing the reporting services as being a "data movement" tool but more of a shell data access tool (correct?).
Usually, our in house ERP software has 1 database and 1 database file. After an upgrade from MS SQL 6.5 to MS SQL 7.0 I have a database who's properties show that it is made up of multiple datafiles. What is the easiest and safest method to return this database to only have 1 datafile?
We're having DB Design discussions in our office for a new project. Basically, we're trying to decide on a DB Solution that allows us to manage multiple online communities. We expect to have several hundred thousand users (about 100k per community), and each user will have associations to user-specific content on the community level.
At some point, we expect to have to export one or several communites into their own Datasource. This will be a downstream event that will not affect us in the immediate future.
In terms of administering the DB and each community, we're having trouble deciding between generating this DB in one inclusive datasource vs creating multiple datasources (one for each community). With that in mind, any advice or suggestions that anyone may have on this subject would be appreciated.
FYI -- We're running CF v4 and MSSQL v7.
Our concerns are as follows:
Data Structure Issues (what abilities/SQL functions will we lose when implementing multiple DB's vs one DB? We definitely have a need to be relational at every level of this application.)
DB Performance (will a one DB solution run more efficiently on MS SQL v7 with high traffic than several DB's?)
Administration (It's our understanding that multiple DB's will cause us to lose our ability to perform table joins, etc. Are there any other shortcomings that we should be aware of?)
Stability Issues (We've heard that one DB vs Multiple DB's will have fewer threads. We've also heard that MS SQL v7 becomes increasingly unstable as more threads get created. Is this true, or is our understanding of this issue wrong?)
CF Integration Issues (How will CF v4 react to handling a large amount of high-traffic DSN's vs. having one DSN and the same amount of traffic?)
Thanks in advance for all your help. We look forward to hearing from you.
Can anyone tell me if SQL Server 6.5 has anything similiar to linked tables in MS Access? I need to query two tables simultaneously that reside in separate SQL databases. Is this possible, or must the tables reside in the same database?
For example, I have two databases db1 and db2. Table1 is in db1 and Table2 is in db2. I want to query something like this:
"SELECT * FROM table1 WHERE fieldname1 in (SELECT fieldname2 FROM db2.Table2 WHERE...)
I want to know if it's possible for a database on multiple devices to put specific tables on specific devices?? and if this is possible how to do it?? Thanks for help
Is there any feature in SQL Server 2000 through which I can translate my Database into different languages at runtime.
Thanks & Regards Anoop Singhal Oracle Certified Professional Team Leader (Database) KeyWest Business Systems (P) Ltd. Ph. 0135-2710533,2710511 Cell: +91-9412051028
We have a system with multiple modules, for each module we have a separate database. Is it better to have multiple databases or have multiple schemas. Performance, advantages, disadvantages... When is too much too much, 10-25-50-100 Schemas???
I need to design a system which represents multiple "projects" in SQLServer. Each project has the same data model, but is independent of allothers. My inclination is to use one database to store all projects.Looking at the numbers involved, however, I wonder if I would getbetter performance by storing each project in its own database.Suppose I have 50 projects, each with two users and 10,000 rows; itseems to me I'd rather have 50 x 2 users working in a table with 10,000rows than 1 x 100 users working in a table with 500,000 rows.On the other hand, the single database approach seems more elegant froma design perspective. I wouldn't be creating multiple copies of anidentical data model, and I wouldn't be creating new databases as abusiness procedure, every time a new project is required.Here are my questions:1. For the scenario described above, am I correct to assume I will getbetter performance by using multiple databases, or does SQL Server havesome clever way of achieving the same performance in a single database?2. Is the multiple database approach common? If anyone has tried it,please tell me about how it works in practice.-TC
I want to create one more publication on a database (SQL Server 2005) that is already a publisher and has subscribers. The subscribers of the second publication will not be inserting new records so I will mark the articles (tables) as download-only.
Is there anything extra that I should take into consideration? Are there any side effects of this process?
Hi all, We have a remote server which runs SQL server 2000 DEV edition. We have 4 databases running in it. Our application needs the feature of Full Text Search in all the four databases. We have installed the necessary services. The problem is that we are able to create FTS on one database but when we try to run FTS on other databases the MSSearch service stops. on restarting it mssql stops. we are not able to do FTS on more than one database. We had tried the same in our local server but it is working fine. The only difference between the two is that the local machine are member server. Has this to do anything with the FTS? Meanwhile the eventviewer doent help much, it just tells that the mssearch engine has stopped unexpectedly and it has done this 'n' time.
Hi, i'm a novice in all this database transactions stuff so please bear with me if my input is incorrect or out dated. I'm running into the problem of needing to compare or manipulate data that is in 2 tables in 2 separate database. Is there any way i can set up the connection string such that i can access data/tables from both database at the same time in 1 sql command (similar to accessing 2 tables of the same database in 1 sql command)?
Is this currently possible? If not, is it because the execution of sql command must be tied to only one connection string at each instance? Would be great if the wonderful folks at MICROSOFT can look into this and provide us with an upgrade to cater for such a need...
I keep getting this error but it will only insert the 1st row into my database table The variable name '@CustId' has already been declared. Variable names must be unique within a query batch or stored procedure.
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim drow As GridViewRow
For Each drow In GridView1.Rows
Dim textBoxText As String = CType(drow.FindControl("Label2"), Label).Text
Hi, I want to search multiple words that is present in the database, e.g if i am putting "porperty in south delhi" but south word is in the data base, but result does not comes. if I use like operator like this select * from MASTERSEARCH where companyname like '" + txt_Company.Text + "%' or dealsin like '%" + txt_keywords + "%'";Here I put only south word, then result comes. but I want search criteria should be any word that is present in the database.I am using this with my web site. http://www.b2bindialinks.com
I'm developing an application in ASP.Net that uses SQLServer. The database person in the team wants to have each user have a seperate login to the database so he can tell who has done what changes in the database. Is this a good practice? Or are their performancesecurity issues with this model?
I have a question about MS sql 2000 and hope someone can give me a hand though this may not be the most suitable place to post.
I have created multiple databases storing multi-country data. Tables and store proc in each db are exactly the same except they are placed and run in different dbs in runtime.
My question is: Is it possible to centralize all the store proc and function into a central db (or a dummy db) for easy maintenance but it allows us to point to the desired database environment in runtime even I run the store proc in central database.
I find the "Use database" command but it does allow us to use it in store proc. Any advice or suggestions???
Since most use SQL server, I thought I would post the question here.Is it possible, or is there a product or DBMS that enforces referential integrity across multiple databases and database types? Such as SQL Server, Oracle, etc...Thanks,Zath
I want to create several databases with identical properties: size, name (database1, database2, database5, databaseN), path, etc, and I would want to automate the process
So, I downloaded a good T-SQL script from the Internet, which automates the process of creation of ONE database
The problem is I would like to "put" this script within a bucle sentence; I mean, within a FOR or WHILE sentence, so I could create, for example, thirty identicales DBs without prompting me for the database name (without desktop interaction, I mean)
Here you have the generical T-SQL script:
USE master GO CREATE DATABASE emc ON ( NAME = 'emc', FILENAME = D:MSSQL7DATAemc.mdf', SIZE = 5 ) LOG ON ( NAME = 'emc', FILENAME = 'DMSSQL7DATAemc.ldf', SIZE = 1 ) GO
If any oy yoy have some similar script for doing this, I would highly appreciate.
Our programs have and would like to continue keep the same data in multiple database. Example phone numbers. Us DBAs are tring to convince them not to.
Other than keeping the data current, what avantages are there to keep data in one location for multiple application to access.
Just wondering - on a straight RAID 5 system is there any advantage, performance or otherwise, to splitting a SQL 6.5 database over multiple database devices? Or for simplicity's sake am I just further off creating a single device and manually extending it as the database grows?