Tag archive for ‘Database’

Relational Database Table Design – Normalization/Relational Design

Question:
A customer can have multiple products in a cart.
Product
{
productID – PK
.
.
.
}
Customer
{
customerID – PK
cartID – PK
.
.
.
}
ProductsInCart
{
cartID – FK points to customer (unique)
productID – FK points to product
}
As you see, a customer can have only one unique record at purchase regardless of how many products a customer has in a cart (In short, a single cart has [...]

classic ASP Error Handling in Data-Access

Question:
Hi Guys
I am using vbscript/AsP/MSSQL 2005 on my website
Below is a simple dababase-access subroutine in an asp web-page.
I would really appreciate if  someone could add basic error handling to it.
Thank you
Dory
SUB Order_delete
Dim sqlstr
cust_no=session(“cust_no”)
set Objconn = Server.CreateObject(“ADODB.Connection”)
Objconn.open application(“Mydb)
Set rs = Server.CreateObject(“ADODB.Recordset”)
set rs.activeconnection=objconn
sqlstr= “DELETE FROM  ord_save”
sqlstr=sqlstr & ” WHERE ord_save.cust_no like ‘” & cust_no & “‘ ”
rs.open [...]

NTP configuration

Question:
Hi
in our company we have 5 sun solaris server that running database and ERP system, the problem is  that the timing for those server are out of sync. we have in our envoirment windows NTP server.
the question is how to configure solaris server to sync with ntp server and do i need to shutdown database [...]

Are My Normalized Tables Buggy? – Entity Relationships – Relational Database Design

Question:
In short, i’m building a table that keeps track of quotations which we give to customers as well as the ones we receive from 3rd party suppliers. I’m not fully sure if my entity relationships design are good enough, i feel there is something wrong in the tables relationships.
NOTE: I don’t expect you to answer [...]

SQL*Plus export to file

Question:
I am running Oracle 10g on a Windows server.  I can use SQL*Plus to do queries and I understand how to make a batch file to do the queries.  What I need to know is how can I use SQL*Plus to export the query result into a comma seperated file?
Solution:
The most common way is to [...]

Stored Procedure to return an integer value and a table of results.

Question:
I have a stored procedure that returns an integer value (ie the number of rows modified).  I need to know how to return the number of rows modified and the actual modified rows.
I can make an output parameter to hold the number of rows modified, but the rows being modified are in a temp table [...]

Using Microsoft SQL Server Management Studio

Question:
I am using Microsoft SQL Server Management Studio (with SQL Server Express 2008) , and I would like to duplicate a database.  I have tried to take the original database and make a backup, and then restore to to an empty database, but I am unable to figure out how to do it.  If I [...]

Collation Error in SQL 2005

Question:
Hi Experts,
I have just migrated my database from MS-SQL 2000 to 2005.
I observed that most of the views i earlier createdon the 2000 are not sorted accordingly on the MSSQL 2005.
I have severally changed the collation with no success. I have also reinstalled with dictionary settings with no success.
Please tell me what to do. Am [...]

Splitting an Excel File into Multiple Access Tables on Import?

Question:
Hello! New around here. I’m learning more and more as to how badly the data is set up where I work, and coding isn’t exactly my fortay.
Currently, I have many excel files containing 256 columns of data (these are actually coming from .sav (SPSS) files containing 600 or so columns). Here’s the kicker: there are [...]

Can I create Sybase 12.5.4 Answer File?

Question:
Can I create Sybase 12.5.4 Answer File that’s not a silent installation and allows me to run the set-up interactively?
How can I do this?
Solution:
(part of text from http://manuals.sybase.com/onlinebooks/group-as/asp1251e/installnt/@Generic__BookTextView/6494)
Silent installation
A silent installation (sometimes referred to as an unattended install) is done by running InstallShield and providing a response file that contains answers to all of InstallShield’s [...]