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 2008 Forums
 Transact-SQL (2008)
 I think i need to flip the table

Author  Topic 

BigMeat
Yak Posting Veteran

56 Posts

Posted - 2010-03-17 : 17:30:23
Hi

I am using SQL Server 2008 and have a table which lists countries in the following structure:

[Algeria] [bit] NOT NULL,
[Angola] [bit] NOT NULL,
[Benin] [bit] NOT NULL,
[Botswana] [bit] NOT NULL,
[Burkina Faso] [bit] NOT NULL,
[Burundi] [bit] NOT NULL,
[Cameroon] [bit] NOT NULL
..... this table is very long with over 150 countries/regions


I have a stored procedure that passes in the name (@prmCountryName) of a country and only want to select row where the country name equals @prmCountryName = True

Any ideas how i can do this..... can I flip the table axis some how?

Many thanks in advance



tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-17 : 18:49:31
Can the table design be changed? You are going to have problems with this design.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -