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)
 SQL HELP

Author  Topic 

egemen_ates
Yak Posting Veteran

76 Posts

Posted - 2012-08-10 : 04:33:14
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)

17689 Posts

Posted - 2012-08-10 : 04:43:35
no. it is not possible.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2012-08-11 : 23:29:37
[code]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)[/code]

Srinika
Go to Top of Page
   

- Advertisement -