The way this table works is that I have an ASP page that allows the user to
create a stock category at 2 levels, category level and sub-category level.
When I file the entered data into the table, if the user has chosen to
create a category level stock category then the LEVEL field is left blank
and if they chose to create a sub-category level category then I post the
relevant category level stock category code in the LEVEL field. For
example, in the above list cat01 is a category level stock category and
cat05 is a sub-category as it is a sub-category of cat01.
My query is that I want to populate a simple HTML <SELECT> menu (using ASP),
but instead of it being a straightforward 'select catid from stockcats order
by catid', I want to group this list into some kind of order, eg:
instead of:
cat01 <nothing> << I need to bring back this 2nd column so that I can
do a simple IF THEN in asp to indent sub-cats
cat02 <nothing>
cat03 cat01
cat04 <nothing>
cat05 cat01
cat06 cat02
cat07 cat04
Do you know if this is possible in pure SQL (I must confess that I'm using
MySQL, but I would have thought the SQL syntax would be the same if it is
possible) or a combo of ASP & SQL?
All- I would greatly appreciate some assistance in creating a SELECT statement for table headcount in the following problem: First, find the schema here: http://home.pacbell.net/eulimi/schema_headcount.GIF The problem: Given a person_id (a record in the person table), list all headcount records WHERE:1) headcount.person_id = person.person_id AND2) the headcount.act_session_id belongs to a activity (from the activity_session table) that the person is allowed to attend by virture of the person's membership in a subexpedition. Note that: - A person can be a member of one or more circles (via the circle_person table)- Each circle belongs to exactly one subexpedition.- A persons who is a member of a subexpedition (via one or more circles) is entitled to sign up for one or more activities (activity_sessions) associated with the subexpedition. So, put yet another way, the SELECT command should show, for a given person_id, the list of records in headcount that includes the activities (act_session_id) that the person is entitled to join by virtue of the persons membership in the subexpedition via his circle. (Whew!) I hope this is enough information. I think the problem would be fun if I knew what I was doing. (SQL newbie here.) I suspect I need several INNER JOINs and a compound WHERE clause. Thanks in advance!!!
Hi friends this is the Orders to rise the publisheres (Titles or magzines). I have two tables 1) orders Tables the columns are like orderno int , titleId int ,ItContaincomb bit, combinationID int.
2) CombinationTable containg columns like CombId int , Titleid int. values(101,2) values(101,3) values(102,4) values(102,5) valus(103,2) values(103,4)
my requirement is in orders table the last twocolumns should be filled by checking the combination table 1) take 101 combination containg 2,3 titles check these all titles are containg or not . if Compulsory all titles containg means in orders table we put ItContaincomb true, combinationID 101 for all containg titles.
if not containg single title in orders table for combination 101 means we put that titleid rows should containg column of ItContaincomb is false and combid is 0.
i want below out put for above two tables how to write a query or how to use all function. the output is (in orders table) Values(1,2,true,101) values(1,3,true,101) values(2,4,false,0) Values(2,3,false,0) values(2,2,true,103) values(3,4,true,103
The value in the table of one DB is 17869 sq. ft. Now to insert this value in a new table of other database the reporting basis is 1000 i.e I need to do 17869/1000 = 17.8 so I have to take the value as 18. Another thing to be kept in mind is the value in the new table should have leading Zeroes. If the value is 18 it should be displayed as 0000018 ( data type in new table is Varchar(7) and in old table char (9) ). What can be the best way to implement this??
Hi Everyone,I'm drawing a blank here and I am hoping someone can point me in the right direction. I have a table with the following columns (some omitted)IDGUIDPageNameParentPageID I want to build a hierarchical navigation system (2-tier). The conceptual problem that I am running into was getting this information from the same table. Initially I was going to use a nested repeater but I am thinking a treeview would be better. Anyway, the problem is the query. How would I start with something like this? Let's use the following as an exampleRows(ID '1', GUID '888....', PageName 'Page A', ParentPageID '-1')(ID '2', GUID '111....', PageName 'Page B', ParentPageID '-1')(ID '3', GUID '222....', PageName 'Page C', ParentPageID '-1')(ID '4', GUID '375....', PageName 'Page 1', ParentPageID '1')(ID '5', GUID '562....', PageName 'Page 2', ParentPageID '1')(ID '6', GUID '874....', PageName 'Page 3', ParentPageID '2') (ID '7', GUID '388....', PageName 'Page 4', ParentPageID '3') So, I want to be able to build a query so that I can do the followingPage A Page 1 Page 2Page B Page 3Page C Page 4 Any help would be greatly appreciated. Thanks!
Not sure if this is possible, but maybe. I have a table that contains a bunch of logs. I'm doing something like SELECT * FROM LOGS. The primary key in this table is LogID. I have another table that contains error messages. Each LogID could have multiple error messages associated with it. To get the error messages. When I perform my first select query listed above, I would like one of the columns to be populated with ALL the error messages for that particular LogID (SELECT * FROM ERRORS WHERE LogID = MyLogID). Any thoughts as to how I could accomplish such a daring feat?
Hi I am looking to buy an SQL server2005 with 5 CAL's for my company in UK to fulfill our database management requirements. There seems to be a big difference between the US and UK prices. The US prices are somewhere around half the price of what i could get in UK. Are there any tax implications if i order one from US. Would there be any problems of registration if i buy from US. Any answers would be greatly appreciated. I need to order them asap. Thanks
Hi, not exactly too sure if this can be done but I have a need to run a query which will return a list of values from 1 column. Then I need to iterate this list to produce the resultset for return. This is implemented as a stored procedure
declare @OwnerIdent varchar(7) set @OwnerIdent='A12345B'
SELECT table1.val1 FROM table1 INNER JOIN table2 ON table1. Ident = table2.Ident WHERE table2.Ident = @OwnerIdent
'Now for each result of the above I need to run the below query
SELECT Clients.Name , Clients.Address1 , Clients.BPhone, Clients.email FROM Clients INNER JOIN Growers ON Clients.ClientKey = Growers.ClientKey WHERE Growers.PIN = @newpin)
i HAVE one requirement in a table. that is column1 for first record value 100next record 101next record 102next record 103for next 104I want to update that table daily with this requirement.not with identity columnnext day 100 may be 220,339, some thing random numberlike this how can i update a table column1
Hi Experts , I want to insert datas randomly to all columns of a table.The columns have different datatypes like int,varchar,datetime. What to do??? It is urgent so please help.
Hi,As subj says. A simple menu is defined in a table. But how to extract it?Heres the deal:Table menu has these 3 columns: menuid parent menudescOk this should be easy right? Those menu-rows that has parent=0 is"toplevel". And so forth. An example:1 0 "Items"2 0 "Standings"3 0 "Test"4 2 "Liverpool"5 2 "AC Milan"6 1 "Itemno1"This menu should in layout come in this order:ItemsItemno1TestStandingsAC MilanLiverpoolThat is: Alphabetically sorted and with the children underneath the parents.Right? Yes - and selecting the menu and doing some gymnastics in ASP isntthat hard. But ASP must be the language that has the "crapiest" way ofhandling arrays...so a simple task is really messy. Creating a storedprocedure involes 2-3 temporary tables as I see it. Not vey elegant either.So my question is: Isnt there any way of selecting this order directly usingSQL?? Some nice clean and beautiful way?--Thanks,Summa
Is there any recommendation of how to calculate what would be a suitable hardware requirement for running a huge database on Production. I have a database with over 150GB of data. The server has 1.5GB memory. The database is indexed. The size of the database will most probably exceed over 400GB of data. Is there any recommendation on how much memory / hardware to put on the box.
Also on a side topic, how do large sites (example - microsoft forum) keep storing information in a database and still allow fast searching? Do they move old info to another database... But I am able to search across old information as well.
The problem is that while I am installing Sql 2005 the two warning messages are given that €ścom plus catalog requirement€? & €śminimum hardware requirement€? So please suggest me, what I have to do to install successfully
I followed an article which was recently published by Jeff Prosise in his "Wicked Code" column in MSDN magazine and I was able to make it work.My problem is that I do not know how to refresh the menu. If I add new record in the sitemap table what needs to happen to refresh the menu.
Hello,I am upgrading my (simple) cms from one menu layer to two layers. So i have two tables in de my DB- table_mainmenu- table_submenuThe submenu records are linked to the mainmenu records on the mainmenu id. So far so good. Heres my problem, i cant figure out how to change the order of the pages...!? What is the theory behind recording the stacking order of the menu items? How can i record this information in the DB?I just need the theory, i can figure out the details for myself. Thanks in advance!Corstiaanp.s. is the the right forum to post this?
I have a table called suppliers where i type my suppliers details. I have also a table called supp_corellation in which i have the proffesion of my suppliers.
there is one column in the table of suppliers which it takes data from the table supp_corellation . Is it possible to choose the values from a list instead of typing in my table (lets say drop down list)???
Microsoft Internet Information Services (IIS) is either not installed or is disabled. IIS is required by some SQL Server features. Without IIS, some SQL Server features will not be available for installation. To install all SQL Server features, install IIS from Add or Remove Programs in Control Panel or enable the IIS service through the Control Panel if it is already installed, and then run SQL Server Setup again. For a list of features that depend on IIS, see Features Supported by Editions of SQL Server in Books Online.
how do i get hold of Internet Information Services I installed it on vista premium.
We are running four servers at different sites say A,B,C and D and wantit to connect main Server at head office what would be theconfiguration of main server for running SQL Server 2005.There are twodatabase say X and Y at each server at sites A,B,C and D. X requires37.4 MB memory while Y requires 154 MB memory. 500 records arepopulated in X database at each site While 30000 records are populatedin Y database at each site. What would be HW requirement for SQLServer?With regardsAli Raza Rajput
Hi, I read throught the requirements of installing SQL Express and found that one of the requirement stated Microsoft .NET Framework. As I'm now developing my application in VC++(MFC), it's not build on .NET Framework. I wish to know in my case, can I use SQL Express in my application? Thank in advance.
I am in the process of learning SQL from scratch and figure it would be helpful if I can run a local server and experiment with it as I move along some book reading. I have a few questions regarding the operating system requirement for running a localhost server and hope some of you can answer to my novice questions. Can I setup a server under Windows XP? when I looked thru the documentation it indicated only windows 2000 and other Microsoft server OS will support a SQL server setup. Why then it also indicate XP as compatible? Is it because it's compatible as a client? If I do have to run a server under a different operationg system, what is the best approach for setting up another server on my only PC system along with my XP. Thanks for any answers and comments in advance.
I have developed a client server application using SQL Server 2005 Express and VB.Net. I will be distributing it to my customers. I am putting together a System Requirement document. I am wondering what kind of Server (o/s) and network configuration customers need to have. I know they cannot use a pier to pier network setting. What kind of network setting do they need to have? Does the server machine need to have a server o/s (such as Win 2003 Server) or is Windows XP fine? Any help will be appreciated.