Extract column name of a table
-
hi how to extract column names of a perticular table can anyone tell me the query for that Thanks Thanks
Assuming SQL Server (because you don't say what database you are using)
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'NameOfTheTableHere'
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
Assuming SQL Server (because you don't say what database you are using)
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'NameOfTheTableHere'
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
Assuming SQL Server (because you don't say what database you are using)
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'NameOfTheTableHere'
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
hello, try out .. one of these.. 1. sp_columns tablename 2. select name from syscolumns where id = object_id('tablename') vivek
Why are you telling me this? You should be telling the OP. Also, since he eventually admitted to using access these won't work in his situation because they are SQL Server specific.
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog