Associate Each Product With Multiple Bikes (was How Should I.....)
Aug 26, 2006
Hello, im brand new to these forums, scrolled through a bit of the forum(mainly trying to figure out how to go about what im about to ask) and it seems like a good forum...anyways onto my question.
i am in need of ideas/know-how on how to structure a database like such:
its an online motorcycle accessories website, and this is the information i need to store in the db(basically these will be my tables in the db)
bike manufacturer
bike name
products
now my main question is how would i structure those tables so i can get this effect.
each product in the product table needs to have a bike associated to it, 99% of the time it will be more than one bike associated to it, so how would i go about doing that?
originally i had set it up with the bikes name being different columns in the products table with a bit type set to 1 if that product was available for that bike and 0 if it wasnt available. however as you are probably already thinking that isnt the best way to do that.
so what is the best way?
any info at all would be greatly appreciated.
thanks in advance
View 2 Replies
ADVERTISEMENT
Nov 5, 2015
I am trying to build a query to identify customers that purchased the a specific product (e.g. db1.product_id = '123') on different dates. Â All of the information needed is in the same db. Â How do I do this?
Select db1.customer_id,
db1.product_id,
db1.purchase_date
From db1
View 20 Replies
View Related
Nov 18, 2015
I successfully used the query below to identify customers that purchased the a specific product (e.g. db1.product_id = '123') on different dates. Â Now I need to only pull the purchases from a particular region (client_cd = '593') that purchased a particular product on different dates. Â How can I do this?
select distinct T.* from db1 T1
where exists (select 1 from db1 T2 where T2.CustomerId = T1.CustomerId and T2.ProductId = T1.ProductId and T2.PurchaseDate
<> T1.PurchaseDate) and T1.ProductId = '123'<o:p></o:p>
View 3 Replies
View Related
Aug 30, 2015
I am using the code below to get all the children of a particular product and it is working fine. How to get the particular product's id in the select statement. for example, i need to show 891 in a separate column for all the records returned by the query below.
DECLARE @Hierarchy TABLE (Product_Id INT, Parent_Product_Id INT)
INSERT INTO @Hierarchy VALUES (123, 234)
INSERT INTO @Hierarchy VALUES (234, 456)
INSERT INTO @Hierarchy VALUES (456, 678)
INSERT INTO @Hierarchy VALUES (678, 891)
INSERT INTO @Hierarchy VALUES (891, NULL)
[Code] .....
View 3 Replies
View Related
May 8, 2008
Hi. We're trying to setup a new case management system and I'm having a problem trying to store some of the information. I think I know how to go about it; however, I'm not sure if it's right.
We have two tables: Cases and Clients. The cases table stores relevant case information like case number, case type, etc. The Clients table stores information like name, address, phone number, email, etc.
What is the best way to associate these two tables together? I'm assuming I need a third table. Right? Thanks!
View 7 Replies
View Related
Dec 28, 2006
Hi all.Running SQL2K SP4 on W2K3 Standard, SP4.I have just refreshed a database on one server with a backup fromanother. The database had existed previously on the target server, andI am just refreshing its contents. I used the following approach1) From the target server, create a SQL script with users and roles2) From the source server, back up the db3) Transfer the file4) Restore the db, checking the location of the data and log files toensure correctness5) Remove orphaned users6) Run in the users/roles script generated in step 17) Run in a canned script containing object-level grants.I've done this dozens of times in other databases, but something alittle unusual has occurred here:My dbo user is orphaned. Normally it's associated with the 'sa' login,but at this point there is no associated user.I can see why this has happened - on the source db, the dbo user hasbeen associated with a non-default login.And, many of the objects in the db are owned by dbo.The only viable option I see is to change the ownership of theseobjects, drop dbo, re-add it with the association to sa, and reassertthe object-level grants.But what I would prefer is some way to change the association of thedbo user, to associate it with 'sa' without the need to drop andrecreate.Can anyone suggest an alternative strategy to associate a login and auser after-the-fact?Thanks much for all input!BD
View 4 Replies
View Related
Mar 23, 2007
(Spam Removed)
View 1 Replies
View Related
Aug 16, 2007
Hi there,
I'm wondering if there is a way to associate a job or task of some kind (i.e. SQL Agent job or SSIS package) with the generation of a report?
I have a need to provide an on-demand report that somehow initiates the updating of its data source prior to generation. In other words, I'd like the report to do *something* that can start an external process (external to the report) and wait for that process to complete before proceeding with the report generation.
As you can probably tell, updating the data source is expensive. It is normally scheduled along with a scheduled report, but I'd like the report to be runnable on demand when that is (rarely) the need, and I'd also like to guarantee the data source is updated when the scheduled report runs, which I can only do if I can somhow create a dependency between the updating process and the report generation.
Any ideas?
(The only way I can see to execute code synchronously from the report is to build a custom data processing extension/provider, which is fairly absurd.)
Thanks
Sam
View 2 Replies
View Related
Aug 21, 2007
Currently a 2005 login has been granted sysadmin because I can not figure out how to grant the same login the SqlAgentUserRole. I thought I would use SSMS but there must be a trick. The role only exists in the msdb database, which the login has not been granted explicit access to. And the login does not appear in the list of Role Members or its sub windows. This should be real easy and intuitive . . .
Thanks!
Michael
View 3 Replies
View Related
Aug 21, 2006
i begin for Data mining ( analysis manager - sql server 2000)
i create some mining model with Microsoft_decision_ trees or Clustering. it's oK
but now i want to create a model to know "If customer 1 has product A in their basket, what products should I recommend ".
i read and see that "Microsoft analysis manager sp1" have support association rules.
i install pack 4. but i don't see anything else . how i create a model with association rules.
View 3 Replies
View Related
Nov 22, 2004
Hi all, I've had this issue in the past but dealt with it in a way that I don't think is correct:
Let's say I have a database on Server1. On Server1 I create a login and a user on the database. Now I have User1 with a login authorization on Server1 as well as a user within my database. If I detach that database now, and re-attach it on a different server, User1 exists. Of course, on the new Server2 User1 does not have authorization to login. I've deleted the existing user in the database and then re-created a login on the server, cascading through with the GUI setup to re-create the user within the database, too. Of course this gets ugly if the user has objects within the database. If I create a server login with the same name as the database user the login is not associated with the user too, correct?
I'd like to know the way that I can create a server authorization tied to the existing database user without dropping that database user, preferably within Enterprise Manager.
Thanks all,
MC
View 1 Replies
View Related
Apr 20, 2007
I'm currently running SQL Server 2005, and have been exploring the feasibility of grouping users to use a default file group and data file. This would be to group a set of users to have their new tables reside in a specific data file. I only see mechanisms for moving an already existing objects into a file group or to set the entire databases default file group--not a user level association or dynamic assignment of the default for that user, script, etc.
It's not looking good.
I'm looking for confimration that it's not possible or leads on doing so.
Thanx in advance
View 1 Replies
View Related
May 8, 2007
Hello I installed MS SQl 2005 the eval version and it has expired. I have bought a copy now and i need to put the product keys in without having to reinstall the program. Is there anyway i can do this with having to reinstall SQl again..
Any help would be great
Randy Martin
View 1 Replies
View Related
Aug 18, 1999
I want to upgrade 5 SQL Server 6.5 production boxes to SQL Server 7. I got
SQL Server 7.0 pricing and licensing list from
www.microsoft.com/sql/70/gen/pricing.htm and I think I should buy 5 SQL
Server 7.0 Combined Product/Version/Competitive Upgrade (Since I have been using SQL Server 6.5, I don’t need to buy the full product. Is this right?). I am not sure if
the upgrade offer (the price is much lower than the full product offer $699/$1399) includes the SQL Server 7.0 both software and access license.
Thanks for any help in advance.
Stella Liu
View 1 Replies
View Related
Jul 14, 2004
Hi,
I am interested in opinions on the following,
main(product_id, short_text, price, type)
productTypes(type_id, type)
productTables(type_id, tableName)
productA(product_id, field1, field2)
productB(product_id, field1, field2)
To retrieve all products of type 'A', one must know the table name, in this case 'productA'.
Here is one method.
Create a table that contains the table name that corresponds to each product type, thus the stored procedure only needs to recieve the type_id which can be used to obtain the name of the respective table.
View 1 Replies
View Related
Jul 3, 2006
how can i get the product of two fields in sql server?
ie. i want to get like this, - select price, qty, product(price,qty) as amount from xxx - like this
View 2 Replies
View Related
Feb 6, 2008
I am installing SQL Server x64 on a new server, and I was told to use the same license key we have for the other servers... but no one seems to know where it is. Is there any way I could see the license key for one of the working boxes so I could put it on the new one?
Thanks,
View 3 Replies
View Related
Jul 20, 2005
Does anyone know of a SQL Server product that would let me do the following?Connect to the instanceConfigure thresholds like,1.Show databases not backed up in the last X days2. Show databases that are full that have logs not backed up in the lastx days/hours.3. Show jobs that have failed in the last x days.I would then like to click a process button and have it bring back anythingthat is outside those thresholds?, any thing like that in a windowsapplication?
View 1 Replies
View Related
Mar 27, 2007
Hi All,
I have a field with numbers (double datatype) as values and I want a aggregate function that gives me the product of all the values in that field. Is there a way to do that in SSRS?
View 2 Replies
View Related
Oct 27, 2006
I can't find any timeframe for the 1.0 release of SQL Server Everywhere. Is this information available?
View 6 Replies
View Related
Sep 20, 2007
How can the licensing product key with which SQL Server is installed be replaced/updated?
If this is possible, will the same procedure apply both to SQL Server 2000 and SQL Server 2005?
Thanks.
View 1 Replies
View Related
Jun 7, 2006
hi,
I am realy sorry that I am putting this question here since I don't know where to post this question.
We have purchased
Windows server CAL 2003 English OLP NL user CAL
with 5 user license
We got the Microsoft open license agreement after a month or so.
Now I want to know how to proceed with this license.
Since I am newbie to this kindly guide me in this regard.
thanks
View 1 Replies
View Related
Jul 31, 2006
We are building a system that has mobile clients (laptop with XP and tablet with XP). These clients have data moving back and forth to a centralised n-tier server based system. The communications is proprietory and are very low bandwidth (5 KByte/sec).
We've decided that the best approach to handling both the reference data (ranging from trivial to a complex list of items - about 2 million rows) and the day-to-day operational data is with a database product rather than attempting to handle it ourselves within code.
The question is - what SQL platform to use? SQL Everywhere seems to be a fairly good choice except that it does not seem to support stored procedures. SQL Express is another possibility but there are concerns about the size of the footprint and managing the database engine and the database itself.
The users of the mobile client are considered computer illiterate and would not be able to manage any database administrative tasks. They only come back to base every three to six months. History has shown remote management of the machine has proven difficult (if not impossible) via the low bandwidth connection.
The machines have 512MB of RAM and only 40GB of disk. They have to support XP, Office, our client, and our GIS client. What is the best answer?
Traditionally we would have used MSDE.
Regards
Paul
View 1 Replies
View Related
Aug 14, 2007
Dear Jamie,
Thanks for the reply.
We have another problem to solve.
on the node we are getting product A -2 >=1.978
What does it mean (-2) ?
It is mentioned as two time slices ago. Please help me to undertand this.
From
menik
View 1 Replies
View Related
Jul 20, 2007
When I was setting up my new SQL server I entered the CD-KEY off of the wrong license. I don't want to have to uninstall everything to reinstall it with the new CD-KEY.
Is there a way to change the CD-KEY after installation?
View 3 Replies
View Related
Apr 7, 2007
I have a search box on my website which is used to search the products database.
I will be using the search text in an SQL stored procedure that uses LIKE statements. The search string could realistically contain any character.
How do I prevent SQL injection when any search string is reasonably feasible? .
View 2 Replies
View Related
Sep 6, 2007
I know "select distinct ProductId from Product " selects one product only one time how can i apply the same logic in a query like give bellow SELECT I.QuoteRequestItemId, I.ProductId ,P.StorePartNumber from QuoteRequestItem I left join Product P on I.ProductId = P.ProductId ie product with same productId should be considered only oncethere should not be more than one row with same productId
View 2 Replies
View Related
Mar 12, 2014
Here I have attached excel sheet. I want to do row wise sum, product and then sub total.
View 4 Replies
View Related
May 22, 2008
Hi guys,
Does anybody know a convenient way to return the product of a column, similar to something like the 'sum' function?
If I have a table of form id-date-value, I'd like to do something like:
select id, date, product(val)
If not, does anyone know of a way one could structure this as a subquery?
If all else fails, I suppose I'll have to resort to a loop or cursor, but I'd rather not.
Any help would be much appreciated.
View 11 Replies
View Related
Jul 29, 2013
I have a SQL statement with two left outer joins which connects 3 tables. Vendors, Tracking & Activity. For whatever reason, even though each is a one-to-many relationship, I am able to join 2 tables (from Vendors to Tracking) without an issue. when I then join Activity, I get a Cartesian product.I suspected that 'DISTINCT'.
SELECT DISTINCT CASE
WHEN `vendor`.`companyname` IS NULL then 'No Company Assigned'
ELSE `vendor`.`companyname`
END AS companyNameSQL, `tracking`.`pkgTracking`, CASE
[code]....
View 4 Replies
View Related
Oct 15, 2013
I have a table with product_name and introduction_date(when the product was first introduced)as columns. now i wana calculate average as below
if item is sold in previous business year(suppose 2011-12) then avg should be avg price in businessyear(2010-11), if it is newly introduced(suppose 2013-14)then avg should be of current year(2013-14).
Note:- business year Apr-march
View 1 Replies
View Related
Jan 19, 2014
I want to get a list of any Categories where ALL the products in that Category are not published (Published = 0). (I want to get the Categories where no products are listed for it). Here are the tables, not sure where to begin :
SELECT [Id], Published
FROM Product
WHERE Published = 0
SELECT [Id] ,[Name]
FROM Category
SELECT [Id] ,[ProductId] ,[CategoryId]
FROM Product_Category_Mapping
View 3 Replies
View Related
Feb 27, 2007
Steve writes "Probably not a tough question if I wasn't a newbie:
I have two copies of MSSQL 2005 standard edition, intended for installation on a dual proc db server. The server is physically placed in a remote hosting service.
Since I need to install remotely, it's non-trivial how to get the bits over there. I could fed-ex the CDs to the hosting service and have them feed the machine.
However they suggested that they simply use their MSDN version, which I accepted.
But it turns out the MSDN version setup has a pre-populated product key, and does not allow me to entire my own product key(s).
So the questions:
1) besides the product key thing, is there any difference between the MSDN version and the retail version?
2) does it matter that I enter my product key(s) during installation, or do I need to simply posess the keys to be legit?
3) On a dual-proc system, must two keys entered to activate operation on each processor?
So in general, I'm confused as to the technical dependence of installation on the product keys. After $12k I kinda want to use them."
View 2 Replies
View Related