SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL HELP
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

egemen_ates
Yak Posting Veteran

Turkey
63 Posts

Posted - 08/10/2012 :  04:33:14  Show Profile  Reply with Quote
example table have 5 column for example a,b,c,d,e

select * -(a) from example

output this

b c d e

Is this possible?

khtan
In (Som, Ni, Yak)

Singapore
16745 Posts

Posted - 08/10/2012 :  04:43:35  Show Profile  Reply with Quote
no. it is not possible.


KH
Time is always against us

Go to Top of Page

Srinika
Flowing Fount of Yak Knowledge

Sri Lanka
1378 Posts

Posted - 08/11/2012 :  23:29:37  Show Profile  Reply with Quote
DECLARE @s VARCHAR(8000)
SELECT @s=''
SELECT 	@s=@s + Column_name + ','
from	INFORMATION_SCHEMA.Columns
where	table_name = 'example' and Column_name not in  ('a')
set @s = left(@s, Datalength(@s)-1)
set @s = 'Select ' +  @s + ' from example'
execute ( @s)


Srinika
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000