sql server 2008 - Get all columns from an SQL Table without Computed Columns -


i'm running sql server 2008 , having load table without computed columns in it, i.e.

select (all columns without computed columns) my_table

is possible doing so? other work around if need deselect computed columns being loaded?

how looking @ using iscomputed column syscolumns , dynamic sql?

iscomputed (int)  flag indicating whether column computed:   0 = noncomputed.  1 = computed. 

something like

create table tada(   int,   b int,   c (a+b)  ); insert tada (a,b) values (1,2);  declare @tablename varchar(500) = 'tada' declare @columnnames varchar(max)   select @columnnames = coalesce(@columnnames + ',','') + col.name sysobjects obj  inner join syscolumns col on obj.id = col.id  obj.name = @tablename , col.iscomputed = 0  exec ('select ' + @columnnames + ' ' + @tablename) 

sql fiddle demo


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -