November 23, 1999

Adding Records to a Table in an SQL Database

Question: My question is simple, yet I can’t seem to find any help on it. I cannot add records to any of the tables in my SQL database. All the login permissions are set to allow me to do it, but the tables still remain un-updatable. Answer: Is the database

Migration from ACT to MS SQL Server

Question: We currently have two contact databases in ACT. One of them is growing exponentially and at 70,000 records we are already experiencing problems. We are considering switching to MS SQL because it is already installed on our server. But I do not know anything about how it works. Is

Calculating While Querying

Question: I have two fields in my query: SELECT minutes, cost FROM SomeTable However, I would like to calculate the cost/minutes for each row selected. So I tried the following: SELECT minutes, cost, IIF(minutes>0, cost/minutes,0) as avg_cost FROM SomeTable My problem is that the database that I’ve been retrieving from

Data Extract and Input Using SQL

Question: We use Dunn & Bradstreet’s Smart Streem System with a subledger that has a high volume of data, and as of this point has to be identified manually and allocated. Can SQL help with extracting the data?identifying 3/4 key points allocated the DB and CB and only allowing the

Indexing Overkill

Question: If a table has a primary key on columns A, B, and C, is there any advantage to also defining an index on columns A and B? Wouldn’t the optimizer use the prime key even if only the first two columns were included in the Where clause? Answer: Your

Field That Can Hold More Than 255 Characters

Question: I need a text (or char) field that can hold more than 255 characters. Something like a Memo field to hold almost unlimited character data. Is this possible? Answer: Under SQL 6.5 you can use the TEXT datatype. Text is not as simple to manipulate as the other datatypes,

Can Add Records But Not Update Them

Question: I am developing an application package with VB 6.0 and SQL Server 7.0. My problem is that I can add new records to the ADO recordset but I am unable to update the record from the VB form. I have given the permission to select, insert, update, and delete

Deleting a Table in SQL

Question: Once a table has been created, is there any way of deleting it in SQL? Answer: Try: DROP TableName

Updating Two Tables

Question: I have two tables: Yarn {Y_yarn_code,x_code}y_yarn_code being PK Yarn_lot (yl_yarn_code) I need to update yl_yarn_code with x_code where y_yarn-code=yl_yarn_code Answer: Try this: UPDATE Yarn_Lot SET Yarn_Lot.yl_yarn_code = (SELECT x_code FROM Yarn WHERE Yarn.y_yarn_code = Yarn_Lot.yl_yarn_code) Is this what you intended?

No more posts to show