SQL Server administration and T-SQL development, Web Programming with ASP.NET and Javascript, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software

Kodyaz Development Resources

Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.

SQL ile bir tablodaki kolonları bulmak

Last post 03-10-2006, 8:56 PM by eralper. 3 replies.
Sort Posts:
  •  03-10-2005, 3:40 PM 56

    SQL ile bir tablodaki kolonları bulmak

    Aşağıdaki sql kodları ile bir tabloya ait kolonları listeleyebilirsiniz.


    declare @tablename nvarchar(25)
    set @tablename = 'Employees'
    select * from syscolumns where id = (select id from sysobjects where name = @tablename and xtype = 'U')

  •  04-06-2005, 5:03 AM 120 in reply to 56

    Re: SQL ile bir tablodaki kolonları bulmak

    exec sp_columns 'Employees'
  •  04-06-2005, 7:12 AM 121 in reply to 120

    Re: SQL ile bir tablodaki kolonları bulmak

    Teşekkürler :) Bu daha kolay...
  •  06-29-2005, 6:17 PM 241 in reply to 121

    Re: SQL ile bir tablodaki kolonları bulmak

    Eğer INFORMATION_SCHEMA  view 'lerini kullanmak isterseniz aşağıdaki kodu da çalıştırabilirsiniz.

    SELECT COLUMN_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME= 'Products'

    Sanıyorum Yukon yani SQL Server 2005 'te sys* system tabloları sadece geriye dönük destek sağlamak amacı ile yeralmaktaymış. INFORMATION_SCHEMA View'lerinin kullanılması Microsoft'un da istediği bir şey sanıyorum.

View as RSS news feed in XML
Copyright © 2004 - 2012 Eralper Yilmaz. All rights reserved.
Community Server, by Telligent Systems