.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Sql server 2000 Update Query with join

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

I have 3 tables . I will give the structure.

1) TblAgency   

PCC     SCCode  AgencyName

2) SegmentCalculation

PCC  StatusDate  Segment   YTD

  3) TblStandard                // for get abt this table. this is i am only for taking the  StartDate . Once i will get the Start Month   and Year to InPut Month and Year , we are going to calculate the sum of Segment  from Segmet Tabl

SCC   startDate EndDate  

the above is my 3 table structure

Now i want a query for update  second table 

SegmentCalculation.YTD =( 
SELECT     sum(Segment) as Total       
FROM    SegmentCalculation P
        inner JOIN TblAgency A ON P.PCC = A.PCC
   left JOIN TblStandard T ON A.groupcode = T.SCCode            &n

View Complete Post

More Related Resource Links

Insert/Update OLE Attachment(Binary datatype) using SQL server 2000

Hi All, In the same senario how we can Insert/Update OLE Attachment(Binary datatype)  from one source table to other destination table by using SQL Server 2000 not with C# fronend code. Appreciated if you can give fix on this regads, Divakar.

Query to list currently running queries on the sql server 2000

Hi all Who to check, what all queries are running curently on the sql server 2000, I need to list who all logged in and what queries are getting executed and how long its running. Thanks in advance. shan  

Error in SQL server 2000 after the migration (internal query processor error)

I just moved a couple of databases from one instance of SQL 2000 from different hardware to SQL 2000 instance of other hardware and after the move from the application side the app team gets an error -2147217900 - Internal Query Processor Error: The query processor could not produce a query plan.  Contact your primary support provider for more information.', 'E', '2UA929041X. Does any one have any idea about this. I took a trace while they were testing and I found out this in the trace. exec usp_DlyPrc_LogProcessEvent '-2147217900 - Internal Query Processor Error: The query processor could not produce a query plan.  Contact your primary support provider for more information.', 'E', '2UA929041X An idea or direction on this will be greatly appreciated. Thanks hash

update query qith inner join


i have 3 tables ,and i have inserted data in table A from  tables B and C into it

"my A table has column"
Coe_Code , Coe_name , Sdo_code, Sdo_name

"B table has column"

COE_ID,  Coe_Code , Coe_name  (COE_ID is auto incremented)

C table has column

Sdo_id ,Sdo_code , Sdo_name, COE_ID  (Sdo_id is auto incremented and COE_ID coming from B table )

i have inserted data into B table from A
after that i have inserted data into C by taking column from A and B as you can see column and table above by using this query

[insert into C (Sdo_code,Sdo_name,COE_ID ) 
select A.Sdo_code,A.Sdo_name,B.COE_ID from A,B where A.Coe_Code =B.Coe_Code

but my problem arise when i need to update my C table ,i need to update only 2 column (Sdo_name,COE_ID ) in C table coming from 2 different table
i tried so many query using inner join with update  but was not able to update that..

if some one could help me to provide the query..i also tried this query but didnt work...
[update C set Sdo_code=A.Sdo_code,COE_ID=B.COE_ID from C innerjoin A on A.Sdo_code=C.Sdo_code innerjoin B on C.COE_ID=B.COE_ID]

please provide me the query or help me in what ever way you can

vastly different performance of update query on development machine and on server



Using VisualWebDeveloper 2010 on the development machine. All nice and fast.

Using VisualWebDeveloper 2008 on the server. Server runs on Windows Server 2008 and has IIS 7.

It looks like that when 'table', a datatabe filled up in C# code behind, is getting longer (say 100 rows), then the server (whether running the website on IIS or on the local host of VIsualWebDeveloper2008!!!) is really slowing down. Checked it in debug mode and traced it down to


This line takes 5 seconds to execute, with 100 rows. On the development machine, it takes almost no time.

How can that be?

Are there any know issues? Could it be that there is incompatibility between different version of SQL server or something like that? The update works, it is just awefully slow, but only on the server.

What's going on? And how to solve it?

Thank you.

Best regards,


SQL Server 2008 R2 Report builder - Cannot update a list of fields for the Query



I have existing report connected to SSAS cube. When I try to change the query and click OK, i get this message "Could not update a list of fields for the query. Verify that you can connect to the data source and  your query syntax is correct"

My Query syntax and access to data source dont have any problem.  Because fo this issue, i cannot update the query used in the report. How do i resolved this issue?



how to use table valued function with join on table in server 2000


Hi please any oone tell me how to call a table valued function


select * from get_date_time_from_gmt ('+17:45','1879-01-02 00:00:00.000','17:30')  when i call it then it will work properly. but now i have to use columns from cricket_master  

as mention below



* from dbo.get_date_time_from_gmt

Executing XML query from SQL 2005 pointing to SQL 2000 server

Occurs with root command.
Executed as user: DOMAIN\SERVER01. Error Code: 0  Error Source= ADODB.Command  Error Description: Item cannot be found in the collection corresponding to the requested name or ordinal.    Error on Line 18.  The step failed.
Executed as user: DOMAIN\SERVER01. Error Code: 0  Error Source= Microsoft OLE DB Provider for SQL Server  Error Description: Line 1: Incorrect syntax near 'ROOT'.    Error on Line 20.  The step failed.
Dim oCmd, sSQL, oDom
   Set oDom = CreateObject("Microsoft.XMLDOM")
   Set oCmd = CreateObject("ADODB.Command")
  oCmd.ActiveConnection ="Driver={SQL Native Client};Database=Validation;Server=server1;Uid=sa;Pwd=;"
   sSQL = "<?xml version=""1.0"" ?>"
   sSQL = sSQL &

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

sql server 2000 vs 2005


i would like to ask what the difference between sql server 2000 and 2005 

update/delete not working on server only


my aspx page works in VWD, and everything works on the server EXCEPT update and delete sql functions. any ideas?


Extreme ASP.NET: Tools of the Trade: SQL Server Profiler and Query Analyzer


In my last column, I discussed Microsoft® Application Center Test and how it could be used to measure the performance of your Web application (see Extreme ASP. NET: Tools of the Trade: Application Center Test).

Rob Howard

MSDN Magazine August 2005

Data Points: XML Features in SQL Server 2000


SQL ServerT 2000 includes several XML features that let you transform relational rowsets into hierarchical XML documents, read XML documents, and bulk load data via XML. For example, you can pass an XML document to a stored procedure, join the XML to some tables and return a rowset, or even modify data in the database.

John Papa

MSDN Magazine June 2005

ClickOnce: Deploy and Update Your Smart Client Projects Using a Central Server


ClickOnce is a new deployment technology that allows users to download and execute Windows-based client applications over the Web, a network share, or from a local disk. Users get the rich interactive and stateful experience of Windows Forms, but still have the ease of deployment and updates available to Web applications. ClickOnce applications can be run offline and support a variety of automatic and manual update scenarios.Learn all about it here.

Brian Noyes

MSDN Magazine May 2004

OLAP: Build an OLAP Reporting App in ASP.NET Using SQL Server 2000 Analysis Services and Office XP


Many organizations analyze their business-critical data using Online Analytical Processing (OLAP) technology. OLAP-based data mining provides a way to query multidimensional data sets and drill down into the data to find patterns. ASP.NET and the Microsoft Office Web Components (OWC) enable Web-based OLAP reporting. The OWC controls include PivotTable and Chart components that can be embedded in a Web page and scripted by programmers. In this article, the authors build a Web-based OLAP reporting app using ASP.NET, OWC, and SQL Server 2000 Analysis Services to illustrate the process.

Jeffrey Hasan and Kenneth Tu

MSDN Magazine October 2003

Metadata: Create a Database Schema Repository with Meta Data Services in SQL Server 2000


SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.

Alok Mehta and Ricardo Rodriguez

MSDN Magazine May 2003

Scripting SQL: VBScript Interfaces in SQL Server 2000 Let You Transform Data and Provide Reports to


Application service providers often must send information to clients automatically rather than on-demand. For example, a manufacturer may want to know each day how many of their products were sold by a retail chain. While SQL Server is ideal for maintaining this type of database, you have to write scripts to get the data out in a client-friendly format. Here you will see how you can use Data Transformation Services (DTS), a powerful tool in SQL Server, to automate the retrieval and formatting of data from SQL Server 2000 and make the process of pushing data to your users a lot easier.

Alok Mehta and Daniel Williams

MSDN Magazine August 2002

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend