devxlogo

Tip Bank

How to use Union on two databases?

Question: I want to use Union to union two different tables, but they are in different databases. An error message told me that I can’t use Union in this way.

Identity?

Question: I’m trying to get the Identity of records as I insert them into my database. I have tried: OrderID = DataConn.Execute(“SELECT @@IDENTITY FROM Orders”). But this returns a syntax

Reporting duplicates

Question: I am having trouble figuring out how to make a report dealing with duplicates. I need to selcet from a table only instances where the first 10 characters of

Auto assigning primary key values

Question: Is there a way to have SQL Server assign values to key fields automatically, so that every time a new record is added it just increases the prior record’s

Finding the Latest Date in SQL

Question: I have a table with a datefield as part of the key. This was needed because it stores historical information. I need to know how to write an SQL

Avoid Automatic Transaction Aborts Under MTS

If you are developing COM components that run under MTS (Microsoft Transaction Server), you will notice that many times your transaction automatically gets aborted. You can easily avoid this situation

Don’t Import All Items

The import directive in Java can sometimes be confusing. For example, if you put this line at the top of your source file: import java.util.*; Do all the classes in

A Simple Right Mouse Click

Question: I am learning Delphi 4. I’m trying to create a program that can distinguish between a right and left mouse click and perform an operation based on which button