Need SQL Assistance

I've been able to determine that our Store Ops Item database has 31 items 
that are INACTIVE when compared to our HQ database (I ran a SELECT COUNT(*) 
FROM ITEM WHERE INACTIVE = 1). However, I've been unable to determine WHICH 
31 items.

I'd like to run a QUERY that will show me the items in our HQ Item database 
that are different from the items in our Store Ops Item database. HQ is on 
server1 and Store Ops is on server2.

Can someone familiar with SQL tell me the query?

Scott
0
Luminox (155)
3/3/2007 3:31:24 PM
pos 14173 articles. 0 followers. Follow

1 Replies
355 Views

Similar Articles

[PageSpeed] 41

Hi Luminox,
You can run the following query to get the result set (can be run any 
server) but make sure that you have to create the relationship with the HQ if 
sitting and running the command on store, you can do the reverse also. first 
in query analyzer do this

EXEC sp_addlinkedserver 'server1', N'SQL Server' (running at store)
OR
EXEC sp_addlinkedserver 'server2', N'SQL Server' (running at HQ)

Now run this command for test
select * from server1.rmshqsample.dbo.item (at store)
OR
select * from server2.rmssample.dbo.item (at store)

Now run this command to match the items in HQ not in Store.
select * from server1.rmshqsample.dbo.item as HQItm where not exists(
select itemlookupcode from server2.rmssample.dbo.item as STitm where 
HQitm.itemlookupcode=STItm.Itemlookupcode)
To See Matching Item
select * from server1.rmshqsample.dbo.item as HQItm where exists(
select itemlookupcode from server2.rmssample.dbo.item as STitm where 
HQitm.itemlookupcode=STItm.Itemlookupcode)

Appreicate if you rate please.







"Luminox" wrote:

> I've been able to determine that our Store Ops Item database has 31 items 
> that are INACTIVE when compared to our HQ database (I ran a SELECT COUNT(*) 
> FROM ITEM WHERE INACTIVE = 1). However, I've been unable to determine WHICH 
> 31 items.
> 
> I'd like to run a QUERY that will show me the items in our HQ Item database 
> that are different from the items in our Store Ops Item database. HQ is on 
> server1 and Store Ops is on server2.
> 
> Can someone familiar with SQL tell me the query?
> 
> Scott
0
AkberAlwani (916)
3/4/2007 6:05:02 AM
Reply:

Similar Artilces:

Need help with printing Excel document
I want to print it out exactly as it looks on the screen. With all the cells and rows visable. Highlight all the cells you wish to see printed out. Then do File > PrintArea > SetPrintArea...........then do File > PrintPreview.......what you see is what will print out, assuming you have the correct print drivers and margins set etc......... If it still don't work, post back with more details. Vaya con Dios, Chuck, CABGx3 "jody mullis via OfficeKB.com" <forum@OfficeKB.com> wrote in message news:507040B8C48C0@OfficeKB.com... > I want to print it out exactly a...

need some help please, read inside, cheers!!
Hello Peeps! I am trying to work out a formula that can count multiple strings i.e. =COUNTIF($E$3:$E$40,"Setup") But not only have it count look for the word setup, have it look for another word to i.e!!! =COUNTIF($E$3:$E$40,"Setup", "Done") This doesn't work but u get the jist of what i need, any help would be much appreciated!!me! Thanks Alot Kami Wilson Use separate countifs: =COUNTIF($E$3:$E$40,"Setup") + COUNTIF($E$3:$E$40,"Done") Andy. "Wilson" <Lordwils@btopenworld.com> wrote in message news:78na00ppvvbsqt...

Formula needed 01-22-10
Hi I need a formula that will look in one column range for a certain value and for another value in another column range and when they are both found in the same row, will count the number of occurances. Help!!!! Krissy wrote: > Hi > I need a formula that will look in one column range for a certain value and > for another value in another column range and when they are both found in the > same row, will count the number of occurances. Help!!!! http://www.contextures.com/xlFunctions01.html#SumProduct Omit the "values to be summed". =SUMPRODUCT(--(A2...

Need to remove data in table due to input mask; cannot close.
ACCESS Table open, unable to close or modify telephone field. Had tried i/p mask of 0 due to "Unlisted" numbers appearing right-justified when doing a report. I sure thought I changed it back to a NO MASK prior saving the table. Now, table is open and I am unable to do anything with that field, even deleting the content, to satisfy the mask problem. Hands seems to be tied in 'catch 22'; I would have thought (!!??) that the table would not have saved properly if the input mask did not match the field contents. I'm stuck! Thank you so much. =?Utf-8?B?b2ZmZXJvY2t...

To type I need to depress keys for twice as long as usual. Why?
Having inadvertently depressed a "shift" key for longer than 6 seconds, I have created a problem with typing. To type I need to depress the keys for about twice as long as usual, with an associated sound as well. I can temporarily correct this by depressing the shift key again for longer than 6 seconds but I need to make the correction more permanent. How do I do this? This is a Windows thing, not specifically Word. Go to Start menu > Control Panel > Accessibility Options (or in Vista or Windows 7, Ease of Access Center). Turn off Filter Keys. To prevent it from ...

Newbie
I have installed Exchange 2003 (new install) on a new install of Windows Server 2003. When I went to add info for the SMTP server (using Exchange Management System - EMS) I navigated to Servers - Exchange1 - Protocols - SMTP There's no default SMTP server listed in there. How can I get one in there? -Fran- Did you have IIS installed already? <Fran> wrote in message news:vmrpu1h04d06lpot07kbqu78lnsflpqcaa@4ax.com... >I have installed Exchange 2003 (new install) on a new install of > Windows Server 2003. > > When I went to add info for the SMTP server (using Exch...

Trapping SQL errors in VBA
ok... making progress on this relinking SQL tables routine. I was getting wierd results before apparently because I was not passing a UID; it was using my Windows logon (by default I guess) so automatically using a trusted connection. Now I've got another problem! When I intentionally use an incorrect password, I get a popup window with Connection Failed: SQL State '01S00' SQL Server Error: 0 <more lines of similar stuff> but VBA does NOT detect an error. Any idea how I can trap this error? Or is there some other way to test whether a SQL uid/pwd is valid before I start...

Inserted rows, now need Counta function
Hi I've got a data dump. I've figured out how to insert a blank row after a change in name in column A and insert "Total" - so... bill.... bill.... bill Total - bob.... bob.... bob.... bob Total - What I need in column C next to total is to insert the COUNTA function for each person. Any ideas? cheers You say your code inserts a blank row after a change in name and inserts "Total", but your example doesn't show this. Can you post the code you are using to do your "insert"? It will probably be easier to handle the ...

Excel Add-In for SQL Server Analysis Services Error -- Need Help
I have the add-in installed and it was working. However, lately I keep getting an error stating: Excel Add-in for Analysis Services has not been initialized I have uninstalled and reinstalled but no luck. Anyone help out here? Alan ...

Sql Server Indexing With Two or More Columns
I got a question with indexing. If I create an index and select 2 or more columns, what is the difference with that and creating 2 (or more separate ) indexes for them? Thanks mark It depends on what you are doing If you have WHERE Last=@p1 AND First=@p2 there no need to have two indexes , however having WHERE First=@p2 the first index on Last,First may or may not be useful, so in that case having two NCI may be a good idea I mean you need testing it, and make a decision.Also there is no need to create NCI on every column, it is especially true in SQL Server 2005 and onwards w...

need to get rid error message
Last month I tried to install Symantec's Winfax software on my XP Pro machine. For whatever reason, it kept crashing during the installation, and I couldn't figure out a way around it. Now whenever I first start Word or Excel, I get an error message that says: Compile error in hidden module: WinFaxPrintAndMerge I can click OK and it goes away, but what do I need to do to make it so that message doesn't appear again? In other words, how do I fix whatever it is that it thinks is wrong? Any help you can provide would be much appreciated. Thanks. By the way, I'm usin...

Calendar Printing Assistant-won't update
Besides my own Outlook 2007 calendar, I am also the "owner" of a public calendar to which several others have editing privileges. I can add and change appointments to the public calendar, but when I go to print it, my updates are not there even though they are visible on my Outlook screen. What can I do to get CPA to print the updated appointments? My understanding is that CPA does not handle merged calendars very well. You may want to consider using a Outlook Calendar printing app called Wincalendar instead. It allows you to render your Outlook calendar in various...

I need the items to have grades
In any business, there are items of different quality, different origin, different level of concentration etc. For example, Tea powder of 3 qualities: High, Medium, low or Tea made in different countries: India, Malasia, China. In the above cases, the item code has to be same because it is basically the same item, but there should be a way to identify them separately. The best way I have seen, to manage this requirement is to have a 'Grade' Column with the Item code. There should be a Grade Master in the Cards Menu of Inventory Module, where the user can create the Grade Type...

I need a rectangular label set for a DVD case.
not the square ones... but one that's rectangular, approx 7.25 x 5.25 inches. Thanks!! debbieT debbie@truesoaps.com ...

Dual Value Axes advice needed please.
Hi all, need some help with what should be a simple chart. Using Excel 2003, I have a worksheet with a rolling year of data, months on row 1, series titles in A2:A4, values in B2:M4 and Annual Total in Column N (data in N2:N4). As the Annual Total is 12 times the average I want the Total to be assigned to a second Value Axis on the right from the default Value Axis on the left. I have no problem setting a complete Series to a second value Axis, but I want to set a category to the second axis. How can I do that? Thanks. -- Spence To add the secondary category axis, go to Chart menu...

Downloading in Outlook 2003 creates a file "needs list" instead of d/l file
When I have an email with attachment, and I go to download it, it downloads it and sometimes renames it to "needs list". It is the same size as the original file, however it cant be opened by any known program. In this case, it should be a .dwg autocad file, but it has happened a couple of times. the name in the saveas box is correct, you download it, and go to that directory and what you were expecting to be there isnt, instead needs list is there. Anyone here of this before? I searched Google, and the newsgroups and the MShelp files, and found nothing. Any ideas woul...

Domain name not always needed to log into OWA?
This is something I've wondered about for a while. Why is it that only some of our new Exchange Server installs insist on the OWA login <up to 13 chars. of domain name>\<user name> while others have no trouble with only <user name>? "Julie" <julie@somewhere.org> wrote: >This is something I've wondered about for a while. > >Why is it that only some of our new Exchange Server installs insist on >the OWA login <up to 13 chars. of domain name>\<user name> while >others have no trouble with only <user name>? Probably b...

Protection Options, Do I need them all?
I have choices of All Shares/All Volumes/Hyper-V and System Protection If I use System Protection (Bare Metal/System State) do I need to backup the volume and shares? Yes, BMR is for the operating system only. It doesn't back up any user data. System State is the associated registry/Active Directory data. Daniel "TechAnalyst" wrote: > I have choices of All Shares/All Volumes/Hyper-V and System Protection > > If I use System Protection (Bare Metal/System State) do I need to backup the > volume and shares? is it better to use native ntbackup tha...

I need to do a triptic
En que programa puedo hacer un triptico/ I need to do a triptico http://office.microsoft.com/es-es/templates/results.aspx?qu=triptico&av=TPL000 -- Mary Sauer http://msauer.mvps.org/ "frank" <frank@discussions.microsoft.com> wrote in message news:334CFB3C-BFC6-4792-A129-DA25C8BC4354@microsoft.com... > En que programa puedo hacer un triptico/ I need to do a triptico ...

Help...Need to modify data within a column in a .csv file
I have been given a .csv file of several thousand rows, and I need to change column A of each. The brief cutout below shows column A of the first two rows. (I need to skip the first row, which is the headers.) Kinda clumsy to have such a wide column, but the application this file is to be fed after I change the contents requires all the data separated by double-quotes to be in the one column. Cell A2: 09/12/0509/25/05"1417385"121"307"111-11-1111"09/30/05"LASTNAME1 Cell A3: 09/12/0509/25/05"1417386"101"900000005"222-22-2222"09/30/05"...

Database SQL query
Sorry for this post here. If someone knows a group I can go to for this question, please let me know. I have a program in MFC that accesses and updates an Access database. The problem is I can't figure out how to add a field which contains a word with a single apostrophe ie (St. Vincent's). I'm using the CDaoDatabase and CDaoRecordset classes. I understand that DAO is interpreting the apostrophe as some type of terminator but there must be a way around the issue. MS Access has information on how to do it in Access VB but that doesn't seem to work in MFC. Thanks Ughh ...

Need help with frozen outlook
There's a Daemon failure message that's sitting in my mailbox, as the first message, and it causes outlook to get hung up. Every time I start outlook, it opens, then freezes, and I have to go to the task manager to shut it down. I've tried uninstalling, reinstalling and repairing, but the old mail messages keep populating in my inbox when I reinstall the program. I've deleted every trace of outlook from the registry, and tried reinstalling and connecting while not connected to the internet. How can I remove my messages?? ...

Importing accounts and contacts from cdf using CRM migration assistant : nothing happens
Hello ! I spent almost the night to import datas for my small business, everything seems fine in the cdf database, but when I try to move data using the assistant, nothing happens, no records are pumped, and I have no errors. I customized some attributes in the account element, prepared the cdf database from CRM, imported my data ( 11000 accounts ) in cdf, checked the requested values ( seem fine - I use no guid, it's right ? ) and when I execute the import procedure, select only accounts and contacts, everything goes fast, and finally show 0 records moved of 0 : I am having th...

I need your help in transferring XP SP2 unto Flash USB Drive
I have an updated desktop that has Windows 7. I still have my Windows XP SP2 CD. I also inherited an HP netbook that had XP SP2 and wanted to know if it is possible to take my Windows XP SP2 CD and place it into desktop without it trying to reformat it and then to just copy it unto a Flash USB Drive. From there, I can then reinstall Windows XP SP2 unto netbook. Can that be done? Why don't you just use the hidden Recovery partition (not to be confused with System Restore) to reinstall WinXP on the netbook? Speaking of which, why do you need to reinstall WinXP on t...

sql server displays
I would like to know what I can use in sql server report 2008 to display several sentences or paragraphs prior to where I have a table generated. Each table in each report will display the data. To display the paragraph(s) and/or sentence(s) before the table containing data what toolbox item would I use? Should I use a matrix, rectangle, textbox, and or another table? Your question is not really clear, but I think you are trying to do would be done using a list box. Add the list box to the report, put the text boxes you want to display here, then add the table control to the ...