Solved

select varcharcolumn from table where varcharcolumn not in ('term1', 'term2', 'term3')

Posted on 2011-03-17
2
267 Views
Last Modified: 2012-05-11
select varcharcolumn from table where varcharcolumn not in ('term1', 'term2', 'term3')


is this the correct syntax for 'not in' for a 'varchar'
0
Comment
Question by:rgb192
2 Comments
 
LVL 4

Accepted Solution

by:
qasim_md earned 500 total points
ID: 35158828
Your Syntax is correct. If you are using the exact same SQL and getting error its is just that you are using table in your from it is a keyword so you will get an error

try this, this will not give an error:::

select varcharcolumn from [table] where varcharcolumn not in ('term1', 'term2', 'term3')

did that help ? let me know...
0
 

Author Closing Comment

by:rgb192
ID: 35159104
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is the best way to calculate hours worked 5 73
SQL Express connecting form remote error 26 7 49
SQL Agent Timeout 5 64
How to import SQL 2000 database to SQL 2014 5 137
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question