devxlogo

Tip Bank

Deleting Tables

Question: Is there a SQL statement for deleting tables like there is for deleting data from tables? Something like:DELETE TABLE NAME or DROP TABLE NAME Answer: Yes indeed, Drop table

SQL: querying records based on ORDER BY

Question: Can you make a query that returns records based on ORDER BY something? There may be mutiple instances, but I only want the one that is the very first

SQL Adding Records

Question: What is the syntax for inserting multiple records into a single query. I have some files with thousands of records to insert and it’s too slow using Insert into

Stored Procedures: Cursor variables

Question: When I run a stored procedure which uses cursors to do a selection of counts based on a view, it returns the correct (expected) numbers. However, when I rerun

Establish Referential Integrity

Question: How do you Establish Referential Integrity between 2 tables so that when a ticket is deleted from the TICKETS table all associated information in the customer5 table will be

Converting a return to a blank space

Question: I am using SQL+ through COBOL to include a 250 char notes field on a report. If the user has entered a return character in the field (Hex 0A),

Max users

Question: I have 20 user licenses. During some activities, users are being logged in two or three times. Thus I can hit a max user limit with only 9 actual

SQL Tutorials

Question: I am interested in learning SQL on my own and need to know if there are any tutorials or disks that I can obtain so that I can practice

Retaining query results

Question: How do I retain the results of a query for use in subsequent queries using SQL Server? Answer: Well, you could either INSERT or INSERT SELECT your query into