Hiya,
I can't see any need to rebuild indexes. If you run an Update Statistics and a DBCC on a regular basis, this should take care of it for you.
HTH
Tim
Hiya,
I am not quite sure which version of Sybase you are using, but I don't think that Sybase supports the "OUTER JOIN" syntax that you have used.
What should work for you is :
SELECT *
FROM Table_A A,
Table_B B
WHERE A.Field1 *= B.Field1
AND A.Field2 *= B.Field2
Tim
Hiya,
To execute a stored procedure, it is just
EXEC database_name.owner.stored_procedure_name
If you are in the database that the stored procedure is in, and are aliased as dbo, then you can just do
EXEC stored_procedure_name
To list all tables in a database, you need :
USE database
GO...
Hiya,
The function that you need is DATEDIFF. Depending on how you want to see the information, the syntax is
DATEDIFF (part_of_date [eg. dd, hh etc.], due_date, actual_date).
This will give a positive figure for late deliveries, and a negative figure for early deliveries.
HTH
Tim
Hiya,
Depending on which RDBMS you are using, there is a system table that holds the information.
In Sybase/SQL server, the syntax is
SELECT name FROM sysindexes
This will list ALL indexes in a database.
If you want to restrict it to one table use :
SELECT name FROM sysindexes
WHERE...
Hiya,
Which RDBMS system are you using? Are you using an Autonumber (Identity) column? If so, in Sybase, there is global variable @@identity, which will tell you the last value used, depending on the system you are using, there may be an equivalent.
Tim
Hi Carla,
You cannot add more than one row at a time when using the VALUES keyword. To add more rows, you need to create more insert statements.
The only way that you can add more than one is when you are copying data from one table to another, when you can use a SELECT FROM in your INSERT...
Hiya,
A having clause should only be used for aggregate functions, such as checking counts, mins, maxes etc.
Try :
SELECT MAX(SELECT Sum(Prescription.Quantity) gross
FROM Doctor, Prescription
WHERE Doctor.DoctorID = Prescription.PHN
AND (Prescription.PCoName="MedCorp")
GROUP BY...
Hiya,
You cannot run across multiple servers on Sybase (not up to version 12 anyway).
All you can do is get the DBA to create a proxy table, which is basically a behind the scenes link between the two servers, so that the table appears to be on the server that you are running your code from...
Hiya,
You could try
SELECT
ACCOUNT_NUMBER,
EM_NO + IN_BANK + NT_BANK AS SPA,
CURRENT_BALANCE,
CYCLE_CODE_99
FROM
dbo.MASTER_CUR
WHERE
((EM_NO + IN_BANK + NT_BANK) IN
('502650000000', '851190000000')) AND
(CURRENT_BALANCE between...
Hiya,
Why don't you try checking @@rowcount to determine if a valid account number has been found, and just running the cursor through table b as below:
create proc check as
begin
declare csr cursor for
select @ac_id=b.account_id
from tableB b
open csr
while (@@sqlstatus !=2)
begin
SELECT...
Hiya,
I may have misunderstood the question, but I think that you only want what is in table 1 and not in table 2 returned. In this case, you should be able to use NOT EXISTS
SELECT t1.*
FROM table1
WHERE NOT EXISTS (SELECT 1
FROM table2 t2...
Pivan,
I suggested allowing some latitude, not a complete free-for-all. At one of the more progressive places that I work, the rules were:
a. Do not let it interfer with your work. If you are waiting for a program to compile or run, or on-hold on the phone, that is OK.
b. Do not use sites...
Hi,
This is probably a simple question, so forgive me if it is....
I am currently having problems processing a file that is sent down from our DOS (I know!!) system to the Unix box. It processes all rows except that last one, which for some reason, it does not read.
However, if we VI the...
OK,
I suggest that you repost this query in the MS SQL forum, you will find many good MS SQL people there.
Basically, you should be able to do it by building some dynamic SQL using system tables, such as sysobjects, syscolumns etc.
HTH
Tim
Hiya,
What RDBMS system are you using? There are several ways, but you need to access system tables to do that you want, unless you want to resort to the good old
SELECT * FROM table_name
Hiya,
I think that it means that a field terminator has been found in the wrong place. You would need to check the source data that you are entering for a field seperator (I think dbf files are delimited with a tab, but it is a while since I worked with them) in the wrong place, meaning that...
First, I have been blessed to have a develpoment staff that does research on their own time or in the course of solving a work related problem. If as part of their assignment, say optimizing compile time, they have to do research, then I expect to see them researching at their desk. Or if it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.