Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Database comparison

Author  Topic 

dougancil
Posting Yak Master

217 Posts

Posted - 2011-07-21 : 12:14:55
I have the following query that I'm using as a stored procedure:

insert into msbtotal.dbo.newclients
SELECT tcms_members.dbo.memberdata2.* FROM tcms_members.dbo.memberdata2 left outer join
msbtotal.dbo.memberdata on tcms_members.dbo.memberdata2.id =
msbtotal.dbo.memberdata.id where msbtotal.dbo.memberdata.id is
null

and what is supposed to happen is that any new entries in one database is supposed to show up when I run this query. I'm not seeing new entries inserted into the newclients database. I've ran a Select * query from the memberdata where the Last_Date_Updated field showed anything since May of this year and I see results, but my query isn't finding those. Can anyone tell me why this doesnt work?

Thank you

Doug

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-21 : 12:25:39
are you sure the ids returned for the select from memberdata does not exist in msbtotal memberdata table?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

dougancil
Posting Yak Master

217 Posts

Posted - 2011-07-21 : 12:56:48
Visakh,

I'll have to verify that. This is part of a job thats done daily from an import of another database. I'll have to let it run tonight and I'll be able to tell you tomorrow.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-21 : 12:58:30
ok..only if this doesnt exist in msbtotal you will get output from above statement

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

dougancil
Posting Yak Master

217 Posts

Posted - 2011-07-22 : 11:09:36
I ran my query again this morning and did find one new entry (since this is ran every night from a datadump from another organization.) I'm going to attempt to do this again on Monday to see if it produces any new results. I think that my process may have been backwards (I was copying the data before I was running the query therefore not able to find any new clients because both of my databases had the same information.) I'll update this on Monday.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-22 : 11:35:27
ok. no problems. let us know how you got on.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -