Viewing 15 posts - 106 through 120 (of 197 total)
> So ordering the #temp1 source table is really not necessary and may actually be slowing down the sp?
Yes, that is correct. An order by on the cursor declaration is required anyway,...
April 12, 2005 at 8:46 am
HI there,
An observation is that the cursor as written is not guaranteed to do what you think it is doing. You mention up front that the data is sorted into...
April 12, 2005 at 7:31 am
Ok. Next test to see what happens:
Replace the sample values with valid ones and run the insert. ...
April 11, 2005 at 2:18 pm
Hmmmm.... By process of elimination, if the "select" portion of the code works, then there must be some problem with the "insert" portion. Try removing [dbo]. from the column names...
April 11, 2005 at 12:48 pm
Melanie,
We are here to help people of all skill levels, backgrounds etc. This is an open forum, with global participation, and there are times when some communication may not come...
April 8, 2005 at 1:23 pm
It sure does. Thanks for your patience. The code to retrieve the first result set is:
SELECT X.store_id, sa2.activity_id as store_activity_id, X.activity_id
FROM TestStore_Activity sa2 RIGHT OUTER JOIN
(
SELECT DISTINCT SA.Store_id, A.activity_id
...
April 8, 2005 at 1:14 pm
Tim,
The simple answer is "no". You cannot easily do what you are asking in SQL Server 2000. There are ways to export the result to a text file, which can...
April 8, 2005 at 12:16 pm
Couple of thoughts...
Can you comment out individual lines in the select to identify exactly which line is causing the error? In dev of course, not production.
I would suspect an issue...
April 8, 2005 at 12:10 pm
Sorry... I did not actually take the code to Query Analyzer. Reverse the join. This will give you all activity for all stores, whether completed or not. Then filter the...
April 8, 2005 at 11:42 am
SELECT SA.store_id, A.activity_id AS missing_act
FROM Activity AS A
left outer JOIN
Store_Activity AS SA
ON A.activity_id = SA.activity_id
WHERE A.release = '5.0'
order by sa.store_id, missing_act
This might be closer to...
April 8, 2005 at 11:33 am
There may also be another hidden issue here. Lets assume a cursor is the "right thing" to do in this case. In normal SQL, one should know whether a cursor is...
April 8, 2005 at 11:28 am
In the where clause the columnname is currently timeRkeeper. Remove the extra R?
G'day
Wayne
April 8, 2005 at 9:59 am
In the activity table in your post, there is no column named "release". Please repost the correct DDL. Lets assume that there is a column called release defined as a...
April 8, 2005 at 9:56 am
Something like the following may work:
create table testtable (
SomeID varchar(10),
Gender varchar(1)
)
INSERT INTO TestTable (SomeID, Gender)
SELECT 'RED', 'M' UNION
SELECT 'BLUE', 'M' UNION
SELECT 'YELLOW', 'F' UNION
SELECT 'GREEN', 'F'
DECLARE @Preference VARCHAR...
April 8, 2005 at 8:11 am
Couple more thoughts as I checked the post to make sure it wasn't truncated...
With this implementation, the rows must be inserted into the TestRule table in sequence of evaluation. A...
March 28, 2005 at 3:20 pm
Viewing 15 posts - 106 through 120 (of 197 total)