(Advance Programming) Parameter Returned as Value

Hi, I wish some body could Help Me, I have being loocking for a solution for 
2 days.

I need to make a simple Query to check if the parameter values are in a 
Table. I want the Query to return "Founds" and "Not Founds".

For Example:

Table Definition: TName

CREATE TABLE [dbo].[TName]
(
    [IdName] [bigint] IDENTITY (0, 1) NOT NULL ,
    [Name] [nvarchar] (30) COLLATE Traditional_Spanish_CI_AS NOT NULL
) ON [PRIMARY]

Values:
Insert Into TName (Name) Values ('Paul')
Insert Into TName (Name) Values ('Peter')
Insert Into TName (Name) Values ('Michael')
Insert Into TName (Name) Values ('Charls')
Insert Into TName (Name) Values ('Pamela')

My Query is:

Select Name From TName Where Name in 
('Pamela','Charls','Peter','Jhon','Monica','Eduard','Nicole')

The result would be:

Name
_________
Pamela
Charls
Peter

This query will give me just the Founds, but I want to know wich records 
where found and wich were not.

I want to know is there is a way to get a result like:

Select InQuery, Tname.Name as InDB from TName IN 
('Pamela','Charls','Peter','Jhon','Monica','Eduard','Nicole')  (Just 
imagin...)

InQuery        InDB
_______       _______
Pamela           Pamela
Charls            Charls
Peter              Peter
Jhon
Monica
Eduard
Nicole

So what I need, is to get the In Parameters as a value for a Column in order 
to know wich values exist and wich others dont.

Thanks in advances, You will really help with your support

Carlos Lee 


0
Hattori
3/12/2010 8:13:41 PM
sqlserver.programming 1873 articles. 0 followers. Follow

1 Replies
579 Views

Similar Articles

[PageSpeed] 37

"Hattori" <concor@nad-int.com> wrote in message 
news:OqGdDCiwKHA.3536@TK2MSFTNGP06.phx.gbl...
> Hi, I wish some body could Help Me, I have being loocking for a solution 
> for 2 days.
>
> I need to make a simple Query to check if the parameter values are in a 
> Table. I want the Query to return "Founds" and "Not Founds".

You can find many versions of a TVF that will take a CSV string and convert 
it to a table.  With that, you can then outer join the TVF to your table and 
use a case expression to generate the values "Found" and "Not Found"

One example:
http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_thread/thread/2366112304848c27/40274338907f5c40?hl=en&q=csv+convert+group:microsoft.public.sqlserver.programming

For more information about the general technique and performance 
considerations:
http://www.sommarskog.se/arrays-in-sql-2005.html 


0
Scott
3/12/2010 8:35:13 PM
Reply:

Similar Artilces:

Does Word have a command that compares to WordPerfect Advance?
I want to advance text to a specific position within the line that is independent of the number of characters that precedes it. Tab will not work as it measures from the preceding character. WordPerfect has a command: "Typesetting" "Advance" that I use for this. Is there a comparable command in MS Word? Word does have an Advance field, mostly for compatibility with documents imported from WordPerfect. If you use the \x switch, it will position the next character at the specified location. According to the help topic on the Advance field, the \x switch &qu...

Default picklist values not appearing on convert from lead to acco
Hi, Converting a lead to an account. I have several picklist fields (on the account) which should bring up a default value. When I create a new account from scratch they all appear. When I convert a lead to an account none of the default values are there. There are no offending mappings or scripts that would explain this. Has anyone else seen this or can offer any guidance. Ta Pete. Default values are not set on enties which are converted or created trough the webservice. The only way to have a default value set for any path is to use the PreCreate Callout. -- Patrick Verbeeten (MC...

using parameters
I have a form which the user selects the BlockNo. The other information that is entered in the form is : 1) NoOfRecordedTrees - RT 2)NoOfSurroundingTrees - ST When the BlockNo is entered, a query runs which picks up fertiliser rates for this Block for all sectors within that block. With RT and ST - it should do a calculation such that it uses Rate/ sector * (RT+ST) to find how much fertiliser is needed for each sector in each block. I would like to add a column to the existing query showing FertiliserAmt using these parameters. How do I specify them within the query. Thanks for your great...

Can I abbreviate one value in a data series?
I've got a chart where one value (8,300) greatly exceeds all the others. Is there a way to abbreviate this value so the other data points show better in the graph? Hi, One way is to break the Y axis, have a look at these examples of how to http://peltiertech.com/Excel/Charts/BrokenYAxis.html http://tushar-mehta.com/excel/newsgroups/broken_y_axis/tutorial/index.html http://www.andypope.info/charts/brokencolumn.htm Cheers Andy CMEknit wrote: > I've got a chart where one value (8,300) greatly exceeds all the others. Is > there a way to abbreviate this value so the other da...

Importing Messages From Another Mail Program
I just set up outlook express 6.00.2900.2180 for XP SP2 and wish to import my messages and folders from Netscape 7.0 mail and when I follow the instructions and click on the netscape Local Folder inbox file, I get a message from outlook that says there aren't any messages in the file. I tried to mail the files as attachments but that didn't work. Is there some other way to export these messages .to outlook express. Ask in an Outlook Express forum. This is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is...

Public folder issue, "messaging interface has returned an unknown error"
I'm running a SBS2003 domain and just added a public folder and a customized form for entry into the public folder. All of our clients (all XP Pro, Outlook 2003 with all updates) can get to that folder and use the form without any difficulty except for one. On one computer I get the classic "The messaging interface has returned an unknown error. If the problem persists, restart Outlook." error message. I have tried a repair install, no change. I have tried making a new profile, no change. I have tried adding / removing his PST file (currently he's not even using a pst file...

Return values that sum to a known value
I have a list of data and would like to know if there is a formula that would return any items from that list that sum to a known value. Have a look at this thread for something similar: http://www.microsoft.com/office/community/en-us/default.mspx?pg=7&cat=&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.excel.worksheet.functions&fltr= Regards, Tom "lmattern" wrote: > I have a list of data and would like to know if there is a formula that would > return any items from that list that sum to a known value. ...

Language Support for all Office 2000 programs
Maybe I'm not looking in the right places, but I'm not finding any language support downloads for Office 2000. Does anyone have a specific link to send me to, so that I can do this? I have important documents that I have to print, but I recently got a new PC with 64-bit Vista. I loaded my 200 Office Suite on the PC, but it no longer is supporting the foreign language that I have throughout my documents. I just get block shapes instead. I need help. Thanks. Start here Deploying Office 2000 with Additional Language Resources http://office.microsoft.com/en-us/ork2000/HA011383...

an attempt was made to load a program with an incorrect format
Hello, This is the error I get on Windows 7. I tried going to the project screen in vb.net Studio 2008, and changing the target cpu to x64. This did not work. Do I have to build the program on Windows 7? I'm sure this must be a common problem for programs going to Windows 7. Thanks for any help. Scott On May 22, 2:17=A0am, "Scott Baxter" <sc...@websearchstore.com> wrote: > Hello, > > This is the error I get on Windows 7. > > I tried going to the project screen in vb.net Studio 2008, and changing t= he > target cpu to x64....

UDF that returns a Hyperlink
Is it possible in Excel 2007 using VBA to create a UDF that returns a hyperlink? Ideally I want a hyperlink where the display name is different to the linked URL. Any ideas? TIA First, if you mean you want the tooltip to show a different address, then I don't think that it's possible. Second, if you meant you want to see something in the cell that isn't the address of the link, then... There's an =hyperlink() worksheet function that may do exactly what you want: =hyperlink("http://www.microsoft.com","Click me!") Third, If you wan...

Selecting cell value for a sum, based on a condition
Trying to come up with a formula or method that will enable me to sum values based on a condition. For example, I have three columns which contain a condition and two amounts. If the condition is of the 'each' variety, one value will be used in the sum. If the condition is of the "square foot" variety, another value will be used. Here is a small diagram that may help visualize this: A B C D 1 Measure Unit Cost S.F. Cost Summed Total 2 Each 3.00 .30 3 S.F....

Close and Restart your program.....
I want to be able to shut down my program and restart is automatically. My purpose is after the user enter's information I want to shutdown the program and restart it with the new information that was entered. The information entered activates new features, but the features can not be initialized while the program is running. It has to be initialize during startup. Thanks for you help!... Dirty Solution: Save your details, call CreateProcess or ShellExecute on your own EXE, terminate your application straight away. -- - Mark Randall http://zetech.swehli.com "Developer&quo...

How to return the primary key from a combo box
I have a table containing two columns Column 1: Primary key Column 2: Name. I want to create an unbound combo box that shows the name but returns the PK. I have these properties set: Control source: <is empty> Row source type: table/query Bound column: 1 Row source: <I have a select that returns the desired records> In cboClient_AfterUpdate() I look at debug.print cboClient.Value and I see the name. I need the PK so I can construct the query for the next combo box. How do I get the PK Thanks for the help -- Message posted via http://www.accessmons...

How do I make X-values of a chart dependent on values in cells?
Greetings. I have a chart which can go from x-value 0 to x-value 200. However I'd like to be able to input min X-value into a cell, and a max X-valu into a cell, and the x-value in the chart changes to reflect that. Is it possible to do that? Thanks for any replies. K -- Message posted from http://www.ExcelForum.com Hi, There is no automatic way to do this but take a look a Tushar's AutoChart Manager for a possible solution. (http://www.tushar-mehta.com/) Cheers Andy Kashgarinn < wrote: > Greetings. > > I have a chart which can go from x-value 0 to x-value 200...

set value of a group of activex control points
Have a spreadsheet that has some 20+ activex control points (option buttons). Is there a way to group all these controls together & set their initial values the same? Trying to setup a "reset" type of operation that would clear all control points. I can do them individually via properties, but it's too time consuming. Any suggestions? ...

Using BGInfo Command Line Parameters
I've read the Help file in BGInfo - but can't figure out how to use Command Line Parameters. When I click on my startup icon, I would like to invoke certain parameters. The line I came up with is: "C:\Program Files\BGInfo\BgInfo\Bginfo.exe /timer:99 /popup /taskbar /rtf:C:\DATA\BGINFO /nolicprompt" Obviously, this is wrong. My Target line reads: "C:\Program Files\BGInfo\BgInfo\Bginfo.exe" My Start in line reads: "C:\Program Files\BGInfo\BgInfo" Please help me by telling me what, exactly, should go in each line. I would also like t...

Storing distinct values in an array
Hello .. in the speadsheet, i have a column containing a series of numbers maybe of them repeated multiple times... i would like to store all distinct values in an array any ideas on how i could do that ... eg , if these were the numbers going down column then 1 3 5 7 5 3 5 7 5 4 3 4 5 7 8 5 3 .. store 1,3,5,7,9,4,8 in an array, in no specifi order thank you shimee -- shimee ----------------------------------------------------------------------- shimeel's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1583 View this thread: http://www.excelforum.com/showt...

Calling a webservice with parameter from contacts
Hi, I would like to call a webservice when i am in a contact form (I made an icon in the left bar to launch it) ; my problem is to get an information from the form to be verified in the webservice : how can i pass the parameters? (I am not yet a great developper in .net...) Thanks for your help this line of course in C# will get you the id of the object calling the code string id=Request.Params["oId"]; -- John O'Donnell Microsoft CRM MVP http://www.microsoft.com/BusinessSolutions/Community/CRMFaqLanding.aspx "B. Guillout" <BGuillout@discussions.microsoft.com&...

Populate cell with a value if another cell has a certain value
All, good morning. i have a issue, i need to populate cell E4 with a value CX/025966 when cell F4 has a text Bond Street. Is there a simple way of doin this? EXCEL 2007 Try:- =IF((F4="Bond Street"),"CX/025966","") If my comments have helped please hit Yes. Thanks. "B2ORL" wrote: > All, good morning. i have a issue, i need to populate cell E4 with a value > CX/025966 when cell F4 has a text Bond Street. > > Is there a simple way of doin this? Use IF() =IF(F4="Bond Street","CX/02...

Advanced Security #6
I am setting up security access for new users using Advanced Security. I am using the by Menu view as my primary navigation tool. However, there are a number of objects within the by Menu view that I am not allowed to change. They appear with a "?" next to the description. Some of them I can locate by navigating through the by Dictionary view. However, there are several that I cannot locate (example: Tools --> Utilities --> Project --> Service Utilities --> Create Routine Master). Is there a guide that crossreferences objects between the menu and dictionary ...

Return at another store
I have posted two day ago about item returns at another store, now I am using Advanced invoicing Add-on I think it helping but I couldn't get the trick of how connect to the original store, I have performed HQ Worksheets but I don't know where it appears on the orginal store, or it appears on the add-on interface I am lost.... appreciating any help. Best regards ...

Show zero values
When a formula returns a zero value, the zero value is not being displayed. I have reviewed the following: - conditional formatting - zero values are checked (Tools/Options/View) - stepped through my VB code (it inserts formulae based on a Worksheet Change event) - locked and hidden values unchecked with and without protection (this should have no effect when the sheet is unprotected) Are there any other circumstances that result in a zero value not being displayed? Are there any other reasons for this occurrence? Cheers John Check also normal cell formatting! there are formats that hide ...

Book/doc on converting XP program to work nicely on Vista?
Any good books or documentation, things I should know about what worked fine on XP that won't work on Vista, what needs to be modified in the program to get it to work nicely on Vista, umm, stuff like that? What's a better way than Journal Hooks for a program to record it's own keystrokes? Journal hooks was always problematic if other programs were running that didn't process their messages correctly, and now on Vista I hear journal hooks have been disabled. try Microsoft Application Verifier. "David Deley" <deleyd@gte.net> wrote in message news:vTqVi.1...

Money 2002 YTD Return
How is the YTD return figured out? Is it based on Jan. 1 2004, will my portifolio go to zero and start over again.Can I change when it calculates the YTD? Thanks John Kelly In microsoft.public.money, John Kelly wrote: >How is the YTD return figured out? Is it based on Jan. 1 >2004, December 31, 2003. > will my portifolio go to zero and start over >again. YTD return will go to zero as the calendar rolls to 2004. But you would not say YTD return is "my portfolio" >Can I change when it calculates the YTD? No, but ...

CButton::GetButtonStyle()
hi! is it possible that the function GetButtonStyle() returns one single style value? where can i get information when to use a mask and when to use the plain value? how about other controls/windows? actually i am a little bit confused about this... thanks, philipp "Philipp Huber" <philipp.huber@innval.com> wrote in message news:bonpkq$7hi$04$1@news.t-online.com... > hi! > > is it possible that the function GetButtonStyle() returns one single style > value? I'm not sure what you're asking, but GetButtonStyle returns the LOBYTE of the GetWindowLong/GW...