Click here to Skip to main content
15,444,490 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i want to fetch all fields of a table in sql server with cursor..
thanks for your help...
Posted
Comments
__TR__ 5-Feb-13 1:21am    
You can use INFORMATION_SCHEMA.COLUMNS[^] to retrieve the column names of a table.
Mehdi Gholam 5-Feb-13 1:36am    
You should write this as a solution.
__TR__ 5-Feb-13 1:56am    
Done.

1 solution

You can use INFORMATION_SCHEMA.COLUMNS[^] to retrieve the column names of a table.
If you are not sure how to use cursor take a look at
SQL SERVER – Simple Example of Cursor[^]
DECLARE CURSOR (Transact-SQL)[^]
 
Share this answer
 
Comments
Mehdi Gholam 5-Feb-13 2:08am    
5'ed
__TR__ 5-Feb-13 4:23am    
Thanks.
Nirali R shah 7-Feb-13 7:22am    
Thank you very much.... :)
__TR__ 7-Feb-13 7:24am    
You are welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900