Tip Bank

DevX - Software Development Resource

SQL stored procedures from VB6

Question: We are always getting “stored procedure not found” error messages. We know it is on the server and we can access the db. Any clues? Answer: Well, if you

DevX - Software Development Resource

Coding blank spaces in a select statement

Question: After the line break in the code below, the blankspace between the quotes is not recognized. I am merely trying to indent the second line, but I get nothing.

DevX - Software Development Resource

SQL Substring searches

Question: How do you select all entries that contain a certain substring? Is there a function like InStr() in VB? Answer: Yes, Check out the charindex function which will Return

DevX - Software Development Resource

How to find the top percentage of users

Question: I want to find out the top 5%, 10%, and 30% customers based on their purchases. For example, my table looks like:CustomerID Purchase(in $)1 1002 500Up to 100 customers.

DevX - Software Development Resource

Passing Arguments to a JavaScript Function

JavaScript functions have a special property called arguments, which contains an array of input parameters. Using the “length” property of an array, you can iterate through the array for each

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

Generate Numbers

Question: I have a field in one of my SQL Server Database tables which I want to increment every time a user enters a new record. I thought about a