Buy Questpond's video subscriptions on
huge discount
.
Online: 4061
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
ASP.NET
>
Loading ...
How to get mutlple columns from database except one column
Posted by
Mahesh_Chs
under
ASP.NET
on 10/18/2012 |
Points: 10
| Views : 1971 | Status :
[Member]
| Replies : 4
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
hii
i have a table in sqlserver with 30 fields, i want to select all the fileds except one field. Is there any shortcut for this.
Thank You
Mahesh chayanam
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Lalitha86
on: 10/18/2012
[Member]
Starter
|
Points: 25
0
Select * From TAble_name ;
Mahesh_Chs
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Mahesh_Chs
on: 10/18/2012
[Member]
Starter
|
Points: 25
0
hi
This query wil give all the columns in the table. but i dont want this...
suppose if i have a table with fields of id,name,sal, i don't want sal , i want only id and name
yes we can write select id,name from table name but in my table there are nearly 35-40 columns.
so i am asking is there any short cut to get all columns except one column
Mahesh_Chs
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Lalitha86
on: 10/18/2012
[Member]
Starter
|
Points: 25
0
do sp_help table_name you will get all column names below
In this U will get all column name copy that and expect the salary in all other just put comma
and do as
select col1,col2,......... from table_name ;
Mahesh_Chs
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Me_Himanshu
on: 10/18/2012
[Member]
Starter
|
Points: 25
0
I think ther is no direct way of doing what you have asked,rest experts may tell.
But it could be done using the temp table like
select * into #temp from yourtablename
//this will copy all the data from your table to the temp table
alter table #temp drop column
sal // this will drop the column you dont want to show from temp table
and lastly
select * from #temp
Regrds
Himanshu Pandey
Mahesh_Chs
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...