2013-02-18 69 views
1

想從SQL Server只提取列名。我的輸出是這樣的:從查詢中只提取列名

anyType{anyType=ArrayOfAnyType{anyType=Finance; }; 
anyType=ArrayOfAnyType{anyType=MIS; }; 
anyType=ArrayOfAnyType{anyType=Purchase; }; 
anyType=ArrayOfAnyType{anyType=Sales; }; } 

我只想名字:FinanceMISPurchaseSales

並將該值設置爲動態按鈕名稱.....

btn1.setText(String.valueOf(optionArray[i])); 

回答

1

我從你的問題明白你想要得到columnames

因此,繼承人查詢

SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('dbo.yourTableName')