Jump to content

rubyknight

Members
  • Posts

    16
  • Joined

  • Last visited

rubyknight's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. For a 2D table I would use One Table with 2 Primary Keys and One more additional table to store whatever valueFor a 3D table I would use One Table with 3 Primary Keys and One more additional table to store whatever valueFor a n-D table I would use One Table with n Primary Keys and One more additional table to store whatever valueLet's say, 3D table...create table THREE_DIMENSIONS ( X int not null, Y int not null, Z int not null, V varchar(32), --Or whatever variable type you wanna use/store constraint pk_three_dimensions primary key (X, Y, Z))If you take the X and/or Y and/or Z from different tables, you can add another foreign-key constraint, as follow: constraint fk_three_dimensions_x_table foreign key (X) references X_TABLE (X) on update cascade on delete cascade, constraint fk_three_dimensions_y_table foreign key (Y) references Y_TABLE (Y) on update cascade on delete cascade, constraint fk_three_dimensions_z_table foreign key (Z) references Z_TABLE (Z) on update cascade on delete cascadeAssume if you want to have a database relationship where deleting a record in X/Y/Z_TABLE's but do not want to erase the records that have same reference, the throw away the "on delete cascade".I'm not sure how many primary-keys you can have in an SQL database. Perhaps it's up to the architecture of different SQL software. If you are using Microsoft SQL, check inside the Books Online short-cut/tool.Hope this helps... or has nothing to do with what you asked.... oops...
  2. Thanks Jay and JustSomeGuy...Yes, all of the ASP-based servers I've been doing are running well 'till now, but after reading some sneak-peeks of ASP.NET I began to... thinking whether I need to migrate to ASP.NET in order to secure my job--whether it is a necessary skills to live as a web programmer etc.I've been using MSSQL 2000, which JustSomeGuy mentioned was not as efficient as the MSSQL 2005, but luckily I always limit the "select" with "top" clause. I remember inserting more than 80,000 simple records of 2 columns (both varchar(32)), and they took longer... exponentially maybe... *gasps!*... but won't do it again!Ok, the questions remain... Will migrating from MSSQL2000 to MSSQL2005 help the database speed greatly or was it meant for upgrades in other technical areas?How about ASP to ASP.NET? ... just when I started to feel at home in ASP forum.
  3. By the way, another way to create the table is by having two tables.... first table to contain the list of people... then second table to contain the relationship... like as follow:create table HIERARCHY ( NAME varchar(64) not null primary key)create table RELATIONSHIPS ( OFFSPRING varchar(64) not null primary key, PARENT varchar(64) not null, constraint fk_relationships_hierarchy foreign key (PARENT) references HIERARCHY (NAME) on update cascade on delete cascade)This second method allows update and delete cascade actions, but the problem remains.... who to neatly SELECT who are offsprings of a particular person?The third option is having a hierarchy-level column attached to the table... like as follow:create table HIERARCHY ( NAME varchar(64) not null primary key, LEVEL int not null)Using the above method, we can find out all the people above certain level, but still can not filter based on who's offspring? (remember the hierarchy levels might go beyond hundreds)...By the way... No, I'm not making a family tree of some endangered species or monsters from aeons ago.
  4. Hi all, I've been working with a few ASP+MSSQL applications, now I'm stucked and need help to solve the following problem.The case this time is for a family tree or hierarchy:- Who is at the top of the family tree- Who are the children- Who are the children of the children- Who are the children of the children of the childrenI thought about having a table referencing to itself, like as follow:create table HIERARCHY ( NAME varchar(64) not null primary key, PARENT varchar(64) not null, constraint fk_hierarchy_hierarchy foreign key (PARENT) references HIERARCHY (NAME) on update no action no delete no action)Now, how to SELECT list of off-springs from a particular person--assuming the hierarchy level goes as deep as more than 20 or 100 levels!?!? Can we do this in database level, and not in web-scripting level?
  5. Another long-shot to use is to find the "max" value of all the ID column, then using whatever application INSERT the incremented-one value to it.Assuming using the auto_increment thingy we have 5 records with ID: 1, 2, 3, 4, 5 in order...We then (for whatever reason) delete record number 2 and 4, thus there are now 3 records: 1, 3, 5...Question:The next time we use INSERT with auto_increment constraint of function, will the new record go into ID number 2, or ID number 6? Just making sure we don't have child-data referencing to the wrong parent object with same ID.I prefer having the ID as uniqueidentifier or some-sort, that way it can also serves as an additional security--too long an ID for people to deal with.
  6. I have created a few small to medium ASP/SQL applications and they're working well.I'm curious though, beside ASP, SQL, WEB server with SSL, should there other components to be included to satisty a generic standard in today's modern e-commerce system (considering automated and manual intruders)?Another curiosity is the implementation of ASP/SQL application for dial-up users, which is considerably slower than Broadband or faster users--is ASP/SQL a good e-commerce (or similar) solution?Hope for some advices from e-commerce/portal veterans. :)Thanks.
  7. Hello all.Sometimes I create a separate VIEW (in SQL) or PROCEDURE (in SQL) to avoid web-users from accessing the tables directly. Hope this helps... or am I making it worse?
  8. >What is the best practice for storing public access username and password for internet users through ASP to SQL server?Hi again, and thanks for being patience with my questions.In some cases, I use one SQL account (username/password) for everybody for certain SQL/ASP tasks, and I have been keeping this account information in separate ASA and Include File/s--is that the best solution?Plus, I was thinking of putting that purpose completely in the single ASA file--is that better than above solution in terms of security?
  9. Thanks again.Last time I tried taking away the file access permission for that include file, it couldn't be used by the web-application service as well... but I could have missed something... I'll try again later and be sure.Is there a program that can brute-force steal all sessions and their values? If so, then putting username and password for public SQL access might be risky too...What do you think about putting username and password in sessions? What are the ups or downs?Actually, this puts me back to the start... What is the best practice for storing public access username and password for internet users through ASP to SQL server?I'm sorry if I'm making a mess... but thanks.
  10. This is just an example... hope this helps....In real, I actually use an #include file to store database connection settings, then write the SQL statement before the HTML tag, and store the SQL replies inside HTML body.<% Dim Svr, CS Svr = "SERVER=" & dbsvrname & "\" & dbhomename & "; " CS = "Driver={SQL Server}; " & Svr & "UID=" & dbusername & "; " & "PWD=" & dbpassword & "; " & "DATABASE=" & dbname Dim oC set oC = Server.CreateObject("ADODB.connection") oC.open CS Dim SQL_1, oRS_1 SQL_1 = "select * from INBOX " set oRS_1 = Server.CreateObject("ADODB.recordset") oRS_1.open SQL_1, oC%><html><body><% do while not oRS_1.EOF%> <li><%=oRS_1("MAIL_DATE")%>, <%=oRS_1("MAIL_FROM")%>, subject: <%=oRS_1("MAIL_SUBJET")%><% oRS_1.movenext loop%></body></html>
  11. That helps, thanks.The chat window coding etc needs to be integrated with another system, like classic web RPG--moving from one cell to another cell with different background and having list of users in that cell, then given circumstances allow unique options available also relative to character attributes.Hmmm, do you remember the chat.yahoo.com around 1995? If it still exists... it was first using HTML (refresh), then upgraded to Java Applet which all users have to download... Now, was that Java Applet in chat.yahoo.com an actual solution to my problem? I would hope so... 'cause if it is yes, then I'd at least have a new lead...Right now, it's either Java Applet or Flash... and my considerations weight more on using Java Applet. What do you think?
  12. Thanks.Originally the problem started from database tables that consist of information shared by public, like e-mail INBOX or ACCOUNTS information. Obviously I don't want them to be accessible by many users with write permissions. So I use another account for public access, then this account information (username and password) I put in the #include file.I agree, masking the account information by pretense of an mp3 song file-name is not a good idea. Most intruders would know where to look first. And yes, the #include file is accessible, but denying them from internet users will not allow the file to be used as it supposed to, isn't it?Is there a way to make the variables inside #include file available to ASP/HTML but NOT available when pulled directly by internet users?Hmmm... so I take it there is no way to create a CA server without having to install Active Server service? 'cause having Active Server and a few other services will greatly increase the burden for my workstation (pretending to be server).I'm so worried about this basic security, since all my e-commerce programs have this loopholes.
  13. By the way, if I may add:With the traditional time-frequency-based method, the server will be burdened with re-downloading lots of information--huge amount of redundancy.I've also thought about:Not making the ASP chat window to redownload every n seconds, but using another frame just to check/compare latest (TOP) time/content post, then if different download the new chat message in a specific frame.But it has bugs and limitations (plus the complexity, ouch!):Is there a way for the server to "push" refresh-command to web-clients?Thanks again.
  14. Hi everybody. This is my second post, so please don't shout at me :)Intro:We have a few web-page "refresh" methods, but I've found them to be time-frequency-based, which will refresh the clients' web-pages every n seconds. Imagine a chatting program that requires people to be able to read every new messages as fast as they were sent to server, or seeing list of people in a chatting room come and gone according to their join/leave actions.Currently I am using Windows 2003 Server Standard version running WEB, FTP, Media services (no SSL) and Microsoft SQL 2000 in same machine, and they're running several on-line database programs without any query problem.Problem:Refreshing the clients' web-pages every 2 seconds might not be a problem in LAN, but would be if they're in the internet, especially with dial-up users.Question:1. How can we automatically force web-clients to refresh their web-page (fetch new data) each time there is a new SQL record; INSERT (new chat message) or UPDATE (a character enters or leaves a room)Note:I hope it doesn't involve Applets or additional plug-ins etc... 'cause my programming knowledge is very limited.Thank you.
×
×
  • Create New...