نمایش نتایج 1 تا 9 از 9

نام تاپیک: بدست آوردن لیست فیلدهای یک جدول

  1. #1
    کاربر دائمی
    تاریخ عضویت
    تیر 1384
    محل زندگی
    مشهد
    پست
    498

    بدست آوردن لیست فیلدهای یک جدول

    سلام دوستان
    می خواستم ببینم چطوری از طریق خط فرمان لیست فیلدهای یک جدول را بدست آورم
    با تشکر

  2. #2
    بادستور زیر میتوانی

    Exec sp_help [Table Name]

  3. #3
    و ایضا:

    select * from INFORMATION_SCHEMA.COLUMNS
    where table_name='MyTable'

    توجه داشته باشید که این View نام فیلدهایی رو نشون میده که کاربر اجازه دسترسی به اون رو داشته باشه.

  4. #4
    For colums of alltables submit:
    select * from INFORMATION_SCHEMA.COLUMNS order by table_name;
    For column list of just an specific table,you have many choices:
    SELECT sc.[name] AS [Columns] FROM sysobjects so INNER JOIN syscolumns sc ON so.id = sc.id AND so.xtype = 'U' and so.[name] = 'UrTblNameHere'
    or
    SELECT [name] AS [Columns] FROM syscolumns WHERE [id] = Object_Id('UrTblNameHere')
    or

    sp_columns UrTblNameHere
    -Good luck and feel free to mail me: baronc_rampantc@yahoo.ca

  5. #5
    نقل قول نوشته شده توسط Achchan
    For colums of alltables submit:
    select * from INFORMATION_SCHEMA.COLUMNS order by table_name;
    For column list of just an specific table,you have many choices:
    SELECT sc.[name] AS [Columns] FROM sysobjects so INNER JOIN syscolumns sc ON so.id = sc.id AND so.xtype = 'U' and so.[name] = 'UrTblNameHere'
    or
    SELECT [name] AS [Columns] FROM syscolumns WHERE [id] = Object_Id('UrTblNameHere')
    or

    sp_columns UrTblNameHere
    -Good luck and feel free to mail me: baronc_rampantc@yahoo.ca
    Please note that Microsoft does not recommend direct queries against system tables where as it is not guaranteed that their structures stay intact in next versions of SQL Server. Your application (and also your SPs, Functions and ..) must rely on specific objects that Books Online suggests (like information schema views, system SPs and ...)

    راستی دوست عزیز، شما نوشتن به زبان شیرین فارسی براتون مقدور نیست؟ افتخار ما به این هست که یک Forum کاملا فارسی داریم، در غیر اینصورت Forum به زبان انگلیسی کم نیست.

  6. #6

    Cool

    راستی دوست عزیز، شما نوشتن به زبان شیرین فارسی براتون مقدور نیست؟ افتخار ما به این هست که یک Forum کاملا فارسی داریم، در غیر اینصورت Forum بزبان انگلیسی کم نیست
    Hi,
    First of all I should say I can't see any problem in English replies.I read the agreement and there is no such a restriction for members so I have the right to post in whatever language I like till I can make a meaningful ,helpful and didactic relationship with my peers.
    It is the most important subject for me and post in this or that language is not matter.
    Notice that out software community is small and young and it is not benefical to restrict others with such a little issues.
    However,the main result in typing English and not Farsi is that my typing speed in these two differ awfully and since I can't share time more than this so this is in a "As is" manner.
    Hope you could get the points.
    -Best regards and feel free to mail me: baronc_rampantc@yahoo.ca

  7. #7
    کاربر دائمی آواتار vadood
    تاریخ عضویت
    فروردین 1382
    محل زندگی
    تهران
    پست
    858
    درست است که تا وقتی مطالب قابل فهم و درست هستند مهم نیست که به چه زبانی باشند اما در این فوروم پذیرفته شده است که مطالب به زبان فارسی پست شوند.
    شما نیز می بایست این قواعد را رعایت کنید. تصدیق می کنید که در فوروم های انگلیسی زبان نیز نمی شود به زبان دیگری مانند المانی نوشت.

  8. #8
    Would you please kindly sending the link of that location for me? I can't find it,I didn't see it in agreement.
    Why one should type in Farsi in your opinion? In English forums that preserve such a right for themselves you are right.But everywhere? no! you may see many many non-English posts in dbforums and ...
    Don't be consistent on your feelings.Let accept that English is the de-facto of technical world(yes i am Iranian too and I don't like this but it is a fact) and most of problems I have ever seen in our developers and software teams as a consultant was their laziness to learn ,read and write in forums.
    Lets practice this,lets read documentation,lets be familiar with Books online,Lets learn how to find information in web and other forums. This is the last post in this context from me,if there is a problem yet I beg from site moderator to inform me and I will terminate my membership.
    -Best wishes and feel free to mail me :baronc_rampantc@yahoo.ca

  9. #9
    کاربر دائمی آواتار emad4000
    تاریخ عضویت
    شهریور 1384
    محل زندگی
    کرمان
    سن
    38
    پست
    257
    میشه در مورد این عبارت INFORMATION_SCHEMA.COLUMNS بیشتر توضیح بدین که چیه ؟

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •