Viewing 15 posts - 61 through 75 (of 142 total)
WHERE Field = ''
If you have multiple spaces then something like LTRIM(Field) = '' OR LEN(Field) = 0 (this is not performance friendly on large datasets depending on the data...
August 21, 2008 at 10:36 am
@temprowcount is null and as such concatenating anything to it will yeild null (if ansi nulls is enabled)
In esence both of your query string variables will always be null.
[Code]
DECLARE...
August 21, 2008 at 10:33 am
you might want to create a reporting database (readonly snapshot / mirror / etc )
And put indexes on the table in that database
A cube would also be a choice.
Basically, it...
August 14, 2008 at 9:51 am
using a numbers / tally table
--drop tally table
DROP TABLE dbo.Numbers;
GO
-- Now re-create it and fill it with sequential numbers starting at 1
SELECT TOP 100000 IDENTITY(INT,1,1) AS Number
INTO dbo.Numbers
FROM master.INFORMATION_SCHEMA.COLUMNS i1
CROSS...
August 12, 2008 at 10:35 am
Just a note.
In sql 2000 you could install an add in to be able to debug ( been a long time).
In 2005 you can debug the procedures ect in visual...
August 12, 2008 at 10:14 am
Make an SSIS package with a transfer SQL server Objects task.
August 11, 2008 at 9:46 am
Make sure the column that is foreign keyed to the large tables are indexed in the large tables.
Check for triggers on the tables impacted.
August 5, 2008 at 10:40 am
you can get and install the client tools for sql 2000 (Enterprise manager)
It can be installed along side SQL management Studio.
Then use Enterprise Manager instead of SMS to interact with...
July 18, 2008 at 10:28 am
Distinct will not work for you, after I looked at your Select closer.
Add this join into your query.
JOIN (SELECT
MAX(EmpID) as EmpId,
SSN
FROM Health.dbo.EmployeeInfo
GROUP BY SSN ) as LastEmpForSSN ON...
June 26, 2008 at 11:47 am
instead of inserting directly into your table you can fill a temp table and then just insert the max id for a SSN into the real table.
or it looks like...
June 26, 2008 at 10:28 am
The view could be faster if it is a materialized / indexed view, but in my experience there are so many constraints on when you can use a materialized view...
June 26, 2008 at 10:22 am
Create your temp table such that it matches your procedure results and then you can fill it.
This does not work multiple levels deep however.
[Code]
CREATE PROCEDURE TestSelect
AS
SET NOCOUNT ON
SELECT...
May 2, 2008 at 12:14 pm
sure.
you just have to join to itself
SELECT DISTINCT
tmp.ShipmentLineItemID
FROM #testSLIS tmp
LEFT JOIN #testSLIS sts ON tmp.ShipmentLineItemID = sts.ShipmentLineItemID
AND sts.statuscode = 'SHI'
WHERE tmp.statuscode...
April 1, 2008 at 6:54 am
SELECT
...
FROM shipmentline sl
LEFT JOIN shipmentLineStatus sts ON sl.ShipmentLineItemID = sts.ShipmentLineItemID
AND sts.statuscode = 'SHI'
WHERE sts.ShipmentLineItemID IS NULL --does not exist
not exists could also be used, as well as not in (which...
April 1, 2008 at 5:46 am
the having statement will go after your group by
WHERE t.Active = 0 AND ....
GROUP BY
t.ConsultantID
, t.ConsultantName
...
March 28, 2008 at 10:53 am
Viewing 15 posts - 61 through 75 (of 142 total)