Actually the Est. Execution plan says that the ContactID clustered index under the donations view is used...however I guess if the index is fragmented your argument would to some extent hold true as this would also result in additional page reads.
In any event I'm going to stick with the 2...
That was actually what I tried first but you cannot use aggregetes in UPDATE statments, viz.
Server: Msg 157, Level 15, State 1, Line 2
An aggregate may not appear in the set list of an UPDATE statement.
There are indexes the contactid fields of both tables.
Thanks anyway SemperFi,
Yael :-)
The following update query is taking a long time to complete - (the longest it has run is 20 minutes before being stopped.)
UPDATE SelectedContactsTbl
SET SumDonations2 =
(SELECT sum(DonationValue) FROM MailManNonProf.dbo.donations d
WHERE SelectedContactsTbl.ContactID =...
Thanks Iker,
I actually got round the prob by putting an index on INVSwitchTransvalidtbl.JobID. Not exactly sure why this was required, it still should have run without the index, albeit slowly. The JobID datatype is uniquidentifier, perhaps it was a quirk of that datatype.
Re the the JOIN...
How's this for weird.
The following query is times out. While it is running an exclusvie Extent lock is created in temp db which doesn't let go.
SELECT jobid FROM INVSwitchTransvalidtbl
WHERE JobID IN (SELECT JobID FROM INVJobsTbl WHERE periodid = 23)
If i use a differnet periodid in...
SQL 2000,
I am trying to pass an Output param from a Stored Proc
(using Exec SQL Task) to a DTS global variable.
This is the SQL task:
declare @retval int
execute @retval = dbo.usp_test
select @retval as rv
I am able to map the parameter to a Global variable and the SQL task works OK but...
SQL 2000, VB 6
I have a DTS package that imports a text file and inserts rows into a DB table; two separate tasks on the same database.
I can run it fine from Enterprise manager. However when I convert it to VB (and add the DTS reference) I find that the Insert task is successful but the...
The following batch aggregates records in one (INVSwitchTransValidTbl)and inserts the aggregates in table INVJobsTbl. It then gets the GUID created for the Jobs records and updates the records in INVSwitchTransValidTbl which formed the aggregates.
The script takes about 30 seconds to process...
Using SQL2000 on a Win 2000 network environment, I am trying to connect to an Access DB located on a different machine by adding it as a linked server.
The linked server appears to be created but when I try to access the linked server's tables folder (using Enterprise Manager) I get an...
I am importing a CSV file to a DB table using DTS.(SQL 2000) The destination table has defaults set for all NOT NULL fields.
Eg
Create Table TableName
(
field1 ... ,
field2 ... ,
CustomerExists bit NOT NULL DEFAULT 0
)
I find that when a NULL is encountered in the import file, rather than...
I want to create a select query that joins two tables from two differnent Databases residing on the same instance of instance of SQL Server 2000.
Is there any way of doing this other than setting up one of the Dbs as a linked server?
Yael
Im running SQL 2K. Have created a Linked Server for an Access database. This seems ok in that i can see the tables listed under the linked server in Enterprise mangager. However when I go to run a select query for the Linked DB I get
Server: Msg 7357, Level 16, State 2, Line 1
Could not...
Easiest way to start is by opening Enterprise Manager. Once you have registered the the server in a Server Group you can easily create a new DB by going to the Databases branch on the tree and right clicking. Once done you can right click on the Database you've created to add tables etc. Its...
I am trying to determine the cache hit ratio a server running SQL2000 on Windows 2000. When I use DBCC Perfmon command in Query analyser I get a ratio of 99.999. However, when using the Cache-Hit counter through NT's Performance monitor the ratio is around 65.00.
Which am I to believe? The...
In this small test app there are two forms. The first from creates an instance of the second form then opens it:
Private Sub Command1_Click()
Dim f as New Form2
f.show
End Sub
The second form (Form2) has the following code:
Private m_Regionid As Integer
______________________...
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.