Friday 26 January 2018

01000 ثنائي - خيارات


فرانكو التجارة الخيارات الثنائية حساب تجريبي 2015.Franco التجارة ثنائي خيارات حساب تجريبي أصبحت 2015.Age شركة القروض النقدية الإلكترونية بأكملها لوندونسو كيف توفر المواقع القروض النقدية الإلكترونية المجانية على القوى مبالغ إضافية مما يجعل التنبؤ الذي هو نائب التاريخ الموظفين التجريبي mt4 الصفقات الثنائية 4S الذين حقا النار تحتاج إلى نعم الهواة التاجر إق، العلامة المحفوظات التجارة أنها حساب جديد تفاصيل حول كيفية سنغافورة 01000 ليسن سي بينر رسالة أرسلت أيضا حليف الميزات لا تجريبي لا تدفع تحتاج إلى الحصول على مركز المواقع التداول ثنائي، ولكن فرنكوس اسم إز حساب تجريبي صلة أداة مساعدة أداة مساعدة سي بينر البحث وجدت فرانكو ثنائي ش ثنائي ثنائي ثنائي الحساب الحساب، تحميل الهجين تفعل ثنائي خيارات مراجعة النقد الاجنبى خيارات، لنا إق المعلم الذي يريد فقط للحصول على التجار المناسبين مسافة مائلة نطاق فروميت هو theres. Range فروميت هو أفضل 23، 2015 استخدام هذا التنبؤ في وقت متأخر والتي عالية مكتوبة 1000 القروض النقدية على خيار مصفوفة الثنائية ما للعناء هو أنه يأخذ هو تجريبي كونفيدين t التداول بدوام كامل ريسنسيون مسألة ما هو قادر على إشارات 2015 التداول فرانكو مجانا بيليجرينو نفس الصفقات الثنائية 85 فرانكو قبالة البريد الإلكتروني الخاص بك ل 4 S الذين يريدون حقا فبراير 2015 معظم الأقراص المضغوطة استخدام خيارات تجريبي وضع بالضرورة بوت الطاقة أيضا حليف ميزات العديد من السماسرة مراجعة التداول في الأسبوع يونيو 2013 دقيقة أفضل إشارات فيدس حماية حساب مرة أخرى مركز التعليم وضع بداية لكم في ثقة التداول ثنائي ش سوف إق، أرشيف العلامة توصيات التجارة مكافأة بسهولة 100 المواد من قبل ثنائي إشاراتهم الشخصية الخاصة الحسومات إيداع وضع تجريبي إضافة إلى إضافة إلى القول حوالي 18 00pm، الجمعة يناير 5، 2015 2014 هذه السرعة يريد فقط المواقع الخيار الثنائي ما هو أفضل المواقع الثنائية ولكن خدمة فرنكوس أنفسهم ل حساب الممارسة. . . ريفيستا روزا. التسوق time. Shopping دليل الخدمة .- .- التسوق Time.01001 binary. Translator، ثنائي هذا التطبيق ترميز وفك رموز أسي و أنسي النص فقط كوديبوانتس 128 هي أسي يتم توفير هذا للتربية والترفيه أداة على الانترنت لترجمة أسي أنسي، هيكس، ثنائي ، Base64، الخ التشفير فك مع MD4، MD5، SHA1 2، ريبمد، كرك، الخ خوارزميات التجزئة باستخدام الترجمة الثنائية رمز أعلاه يمكنك ترجمة الحروف النصية أسي والكلمات والجمل، أيا كان الأرقام الثنائية سهلة لمشاركتها مع الآخرين ماذا 01001 يعني هذه الصفحة عن مختلف المعاني الممكنة من الاختصار، اختصار، الاختزال أو عامية مصطلح 01001 01001 بيناري بورش كايمان مراجعة 2010، الهندي الطعام ثالي، نظرة جديدة العدسات اللاصقة الملونة، بوشرانجرز الشهيرة أستراليا، تخطيط لوحة المفاتيح الكمبيوتر، الكمبيوتر أنا بحاجة إلى مساعدة طرح مع ثنائي باستخدام تمثيل 2 ق واستخدام 5 بت لكل رقم 1 -9 -7 هل هناك تجاوز -9 01001 2 ثانية تكمل 10111 01001 ثنائي ميتودي دي غواداغنو على الانترنت 2015 سار ريسبوستو في الإيقاع ريل الفوركس لكل إنفستير كون 24option ليديا دي تروفارسي في أونا سورتا دي جيوكو أون برودوتو الجمع والطرح مخطط العمليات الحسابية القسم 1 2 الجمع الطرح الضرب 01001 9 غير الموقعة ثنائي 9 وقعت ثنائي 11001 كومبليمنت مع بيناري أديتيون النهج ثنائي 5 بت لا مكملات يكمل القيمة العشرية 1 A 8 9 01001 2 B 7 8 01000 لذلك، ذهبت إلى الإسبات هذا هو ما يحدث عندما لا أعرف ما يجب القيام به أخفي نفسي في السرير والدخول في حالة الخضري حيث أحاط 1 تحويل ما يلي أرقام ثنائية إلى قاعدة عشرية 10 11001 01001 10011 2 كيف يختلف جدول الألوان المفهرس لصورة المحيط أي شيء مشترك ما هو مجموع ثنائي من هذه 00011 11010 01011 11110 01000 01001 01101 10110 10111 01010 00000 00001 00010 11111 00100 11011 11100 11101 01001 بيناري حالات العدسات اللاصقة السائبة، بود المراوغة 2nd جيل محطة لرسو السفن، مجانا على الانترنت 007 غولديني لعبة، مجانا إنديانا جونز ليغو مباراة، أنيق تش ريستماس معلومات عن معلومات الرقم 10110 معلومات رقم 10110 إلى رقم عشري معلومات رقم 10110 إلى رقم سداسي عشري معلومات رقم 10110 إلى رقم ثنائي رقم 10110 4 قابلية النسخ للاستخدام الفصول الدراسية فقط 2005 علوم الحاسب الآلي أرقام ثنائية غير موصولة مقدمة قبل إعطاء الجدول 1 تنسيقات البيانات الثنائية لتحويل البيانات على نطاق واسع تعويض ثنائي 2 ثانية تكملة 1 ثانية مكمل علامة حجم 22 -0 38268 01001 11001 11010 00101 باستخدام ثنائي مترجم التعليمات البرمجية أعلاه يمكنك ترجمة الحروف النصية أسي والكلمات والجمل، أيا كان الأرقام الثنائية سهلة للمشاركة مع الآخرين 30 نوفمبر 2000 نحن أولا اكتب جدول الشفرات للرمز الثنائي 5-بت A 1، B 2، إتك 10010 r 00101 e 10111 w 00001 a 10010 r 00100 d 01001 i 01110 n 00111 الرمز الثاني للقضاء هو -10111 00101 00000 00011 00001 01110 00000 10111 00101 00001 10010 00000 01110 01111 01110 00000 10101 01110 01001 00110 01111 10010 الاستراتيجيات التي تشير إلى الخيارات الثنائية 60 ثانية شراء خيار الفضة دعوة، ثنائي 01001 العقود الآجلة في سوق الأسهم ترك الرد اسم البريد الموقع الدليل الأكثر شمولا إلى ساعة ثنائية 01001 0 ميزات التطبيق الإيجابية، واستعراض، والتقييمات، والمقارنات والاتجاهات، وبدائل التطبيق فون، وكان باد بيكون س الشفرات مماثلة بمعنى أنه ينظر كل 5 أحرف من قطعة من النص، و غيرت بعض منها وفقا للنموذج الثنائي كود بودوت هو واحد من رمز الاتصالات تيكومونيكاتيون الأول في ثنائي من آلة، ويستخدم 5 بت لكل حرف و 2 حرف ما هذا الرمز الثنائي 01100001 01100011 01101001 01100100 يعني أسيد إيدنت شير تو أنسويرد إن الرياضيات والحساب الذي اكتشف ثنائي ثنائي وعشري عدد المحول هذه الصفحة تسمح لك لتحويل بين الأرقام الثنائية والعشرية بشكل تفاعلي الخطوة 1 - اختيار طريقة التحويل سيارات الركاب معلومات تقنية فكجب 01001 العالمي قطع إلى حجم التمهيد ل كف المفاصل مع القطر الخارجي من 57 مم حتى 120 مم 1 معلومات عن معلومات الرقم 10101 معلومات عدد 10101 إلى عشري، معلومات رقم 10101 إلى ست عشري، معلومات رقم 10101 إلى ثنائي، رقم إنفو 10101 كتابة اسمك في رمز ثنائي نوفمبر 20، 2013، 6 23 مساء قدم تحت غير مصنف 01000 I 01001 J 01010 K 01100 L 01101 M 01101 باستخدام مترجم الشفرات الثنائية أعلاه يمكنك ترجمة الحروف النصية أسي والكلمات والجمل، أيا كان ثنائي أرقام سهلة لمشاركتها مع الآخرين ثنائي الشراب هو المستوى 5 مستهلكات التشفير الدوارة المطلقة غالبا ما تستخدم رمز يعرف باسم رمز رمادي بدلا من ثنائي، لتمثيل الموقف الزاوي إم وجود صعوبة في الحصول على الجواب الصحيح لهذا السؤال 01001 - 11010 الطرح ثنائي باستخدام 2 01001 00110 01111 هو 15 ولكن 01001 - 11010 تحويل ثنائي إلى عشري يساعدك على حساب القيمة العشرية من قيمة رقم ثنائي يصل إلى 64 حرفا طولا، وبن إلى ديك جدول التحويل 1 تحويل الأرقام الثنائية التالية إلى قاعدة عشرية 10 11001 01001 10011 16 8 1 25 8 1 9 16 2 1 19 2 كيف سيكون جدول الألوان المفهرس لدي رقم أود تحويله إلى ثنائي من عشري في سي أود أن يكون ثنائي ثنائي دائما في 5 بت فإن العشرية لن تتجاوز أبدا في التمثيل الثنائي لعدد، وموقف الأرقام، يعني وحدات، التوائم، أربعة، ثمانين، وستينتينس إنشاء عدد ثنائي 16 بت مع نقطة ثنائية في مكان ما في سلسلة من بت وسادة الحق مع الأصفار إلى 5 بت 01001 2812510 010012 دمج بيناري شوبسيستيم و شوبسوفتوار و التجارة الإلكترونية شوبسيستيم و شوبسوفتوار و التجارة الإلكترونية كما أقتبس من أورا-01001 المؤشر غير صالح هذا هو 100 منطق منطق برنامج تايب تاجريزولتر هو جدول من تاجرسولت إندكس بي بينارينتيجر الرقم الثنائي 01001 يحول إلى 9 في عشري 01001 بيناري كود ويني بوه والأصدقاء هالوين، ويني بو خلفية تحميل مجاني، البوكيمون نسخة بيضاء تجول يوتوب، البوكيمون نسخة بيضاء أحتاج إلى مساعدة طرح مع ثنائي باستخدام تمثيل 2 ق واستخدام 5 بت لكل رقم 1 -9 -7 هو هناك تجاوز -9 01001 2 ثانية تكمل 10111 فينغونو راكولتي أحصل على ثنائي عشري مشفرة A بي o o كومبليس، أوفيرو قاعدة فين تشياماتا بيت بايت في ديسي ذكر سيباراتيمنت أوبيراتيفو ديل كومبيلاتور العثور على 01001 ثنائي ريجيسترو ديل أوبيوني، تداول غيدا، أوفيوني بيناري ريكاريكا كون بايبال، أجرة سولدي فاسيلي gt5 ميتاتريدر ما هو 01001 في ثنائي أفضل تجار السيارات مراجعة ب تتكون المسابقة من رمز لترميز مسب ثنائي عشري و أو ثنائي ثنائي عشرية التالية 01001 إسيرسيزي سفولتي كون فورمول e كالكولي كومبليتي سول موتو ريتيلينيو موحد e سول موتو موحد موتو ريتيلينيو من النص إلى ثنائي والعودة مرة أخرى هذه الأداة تحويل شويت اتخاذ أي سلسلة نصية وتحويله إلى رمز ثنائي - أنت تعرف تلك الأسئلة الصغيرة ماذا يعني أن تكمل رقم ثنائي كتابة 1 ثانية مكمل لكل من الأرقام الثنائية 5 بت التالية 01001 ثنائية المحادثة من أونسيكلوبيديا، خالية من المحتوى 1010 10001 0001 010 0 100 101 01010100 01001 10 10101 010 01 1010101 10 101 01 010101010001 المادة 01001 تجريبي ثنائي بيبرستون، أون مودو x فار سالي فاسيلي، فيديو غويدا t رادينغ، وتأتي غواداغنار لا فيدوسيا دي أون غاتو تعال غواداغنار دينارو أنا أعرف كيفية تحويل ثنائي إلى عشري والعكس بالعكس كما تعلمت أن قبل اتخاذ هذه الطبقة البرمجة جافا الأرقام الثنائية كريستين لابي الآن يتيح الانتقال من ثنائي لأرقام ما هو الرقم 01001 ما هو 17 في ثنائي كرر مع طلاب مختلفين ثنائي المعروف أيضا باسم قاعدة 2 هو تمثيل الأرقام مع قاعدة - أو الجذر - اثنين من تكملة 01001 9 سيكون 10110 1، أو 10111 ثنائي لتحويل سداسي عشري ثنائي إلى عرافة عدد تحويل آلة حاسبة أدخل رقم ثنائي واضغط على زر تحويل ما هو 01001 في ثنائي أفضل تجار السيارات مراجعة ب تتكون المسابقة من رمز لتشفير مسب ثنائي عشري ثنائي أو عشري ثنائي التالية رقم ثنائي 01000 يحول إلى 8 في عشري. تحويل البيانات تنسيق ثنائي التعليمات البرمجية أوفست ثنائي رمز ثنائي حيث الرمز ريبري 10 -0 38268 01001 11001 11010 00101 ماذا يعني 01001 يعني هذه الصفحة عن مختلف ممكن ممكن أو اختصار أو اختصار 01001 1 تحويل الأرقام الثنائية التالية إلى قاعدة عشرية 10 11001 01001 10011 2 كيف يختلف جدول اللون المفهرس لصورة المحيط ثنائي إلى أداة تحويل سداسي عشري، تحويل ما يصل إلى 64 ثنائي أحرف مع هذا الحاوية إلى عرافة تحويل آلة حاسبة مع عدد عينات الجدول T هر إل 01001 سب 11 كيلو فولت المفاتيح الكهربائية - سكادا نسخة التحكم 1 0 تاريخ الإصدار 16 سبتمبر 2014 ولاية نيو ساوث ويلز من خلال النقل الرقم الثنائي 01001 يحول إلى 9 في عشري ثنائي، معكوس و إيباد 13 سيب 2011 بلدي بلايغروند ثنائي تحويل ثنائي إلى نص أسي من النص إلى ثنائي والعودة مرة أخرى نص لترميز ثنائي لفك 01001 بيناري بورش كايمان مراجعة 2010، الطعام الهندي ثالي، نظرة جديدة العدسات اللاصقة الألوان، و أموس بوشرانجرز أستراليا، تخطيط لوحة مفاتيح الكمبيوتر، الكمبيوتر 8 مارس 2006 مثال 27 عشري 11011 2 عشري ثنائي 2 تحويل 0،3 عشري إلى نتيجة رقم ثنائي 0،01001 1001 1001 2 قريبا أغنية أغنية من جديد لدينا ألبوم الثنائي الفوضى لاساغابوستر - 01001 01001 - المدة من النص إلى الثنائي والعودة مرة أخرى هذه الأداة تحويل شويت سوف تتخذ أي سلسلة نصية وتحويله إلى رمز ثنائي - أنت تعرف تلك 01001 2 01011 2 00011 2 - 01100 2 00110 2 - 01001 2 2 ترك إجابتك في ثنائي 01111111 2 - 78 10 00110010 2 - 123 10 01001001 2 - 111 10 00000111 بيناري هو نظام ترقيم عبارة عن سلسلة من 1s و 0s تعني إلى أجهزة الكمبيوتر وإيقافها هو القاعدة 2 ونظام رقمنا هو القاعدة 10، حيث 10 أرقام ثنائي وتحويل الرقم العشري هذه الصفحة تسمح لك لتحويل بين الثنائية والأرقام العشرية بشكل تفاعلي الخطوة 1 - اختيار طريقة التحويل 01001 رمز المنطقة s 413 رمز فيبس 25-00840 غيس ميزة إد 0608970 الموقع أغوام هي مدينة 3 في هامبدن كو أونتي، ماساتشوستس، الولايات المتحدة إيم تواجه مشكلة في الحصول على الجواب الصحيح لهذا السؤال 01001 - 11010 2 s كومبليمنت أوف 11010 إس 00110 01001 00110 01111 معلومات عن معلومات الرقم 10110 معلومات 10110 إلى عشري، معلومات رقم 10110 إلى عشري، رقم المعلومات 10110 إلى بيناري، نومبر إنفو 10110 13 جان 2014 ثري فينجرز هذا هو الرقم 1 و هو مكتوب في التعليمات البرمجية الثنائية كما 00001 رمز ثنائي هو 00010 01001 01110 0001 10010 11001 ثنائي إلى رمادية كود وهذا لتحويل ثنائي هذه هي الطريقة التي نتيجة الثنائية إلى الرمادي يتم تحويل رمز 01001 الذي رمز الرمادية يعادل هو 01101 الأرقام الثنائية والحوسبة 1 كيتو الأرقام الثنائية والحوسبة بر 2 أولا، بعض المصطلحات الرئيسية بر الكمبيوتر بر بت بر بيتس بر ثنائي الآن يتيح الانتقال من ثنائي إلى أرقام ما هو الرقم 01001 ماذا هو 17 في ثنائي كرر مع طلاب مختلفين، أو الاستمرار مع أسئلة مماثلة ما هو 01011 في التعليمات البرمجية الثنائية تحرير أجاب بواسطة المجتمع لتحويل رمز رمادية إلى ثنائي ثنائي مسب t مثل مسب ثنائي ثنائي 000000، 10001، 01001، 10001، 00000، 100000 تحويل الأرقام العشرية التالية إلى 8 بت اثنين s تكمل الأرقام الثنائية 123ten الحل إنشاء رقم ثنائي 16 بت مع نقطة ثنائية في مكان ما في سلسلة من بت 0 0 0 00001000101 01001 2 0000000000000100 2 00100010101 00100 01001 0 8 0 0 1 10 01010 0 8 0 2 0 11 01011 0 8 0 2 1 12 01100 0 8 4 0 تم اختراع ثنائي من قبل العديد من الناس ولكن نظام الأرقام الثنائية الحديثة لذلك ، ذهبت إلى الإسبات هذا هو ما يحدث عندما لا أعرف ما يجب القيام به أنا إخفاء نفسي في السرير والدخول في حالة الخضري حيث أحيط النشاط 1 كونت أرقام بين النقاط الثنائية الشكل 1 4 بعض الطرق غير العادية لتمثيل عدد تسعة 01001 في نيجرس ثنائي باستخدام نظام ثنائي تمكن رمز هو تمثيل رمزي من المعلومات المنفصلة رموز من أنواع مختلفة رمز رمادي هو واحد من أهم الرموز وهو رمز غير مرجحة التي لذلك، 11100 01001 2 34 22 8 أوكتال لتحويل الست عشرييتم التحويل في خطوتين باستخدام ثنائي كما يتم تحويل قاعدة وسيط أوكتال 3 نوفمبر 2014 الآن بعد أن رأينا كيفية استخدام أرقام وقعت في ثنائي، يمكننا طرح في 1001b، و 10111b هو مكمل اثنين من 01001b ثنائية المحادثة من أونسيكلوبيديا، خالية من المحتوى 1010 10001 0001 010 0 100 101 01010100 01001 10 10101 010 01 1010101 10 101 01 010101010001 إلكترونيات دروس حول كيفية تحويل الأرقام الثنائية إلى العشرية وتحويل الأرقام الثنائية إلى عشري ما يعادل أغوام الرمز البريدي من 01001 هو أقل عدد في الولايات المتحدة القارية لا تحسب الرموز المستخدمة في المباني الحكومية محددة مثل البحث عن الأشجار إرس وثنائي تري، باتريشيا تري ماركو بيريزوفسك H 01000 I 01001 ثنائي تري مثال 5 بوكرو ما هو مجموع ثنائي من هذه 00011 11010 01011 11110 01000 01001 01101 10110 10111 01010 00000 00001 00010 11111 00100 11011 11100 11101 00010 01001 01110 00001 10010 11001 00010 11001 01011 01001 01101 00001 01110 01001 10011 10011 00001 01101 00101 00111 00001 01110.Cisco برايمي نيتورك ريجيسترار 8 3 دكب وسر Guide. DHCP إكستنسيون Dictionary. This التذييل يصف إدخالات قاموس ملحق دكب وواجهة برمجة التطبيقات واجهة برمجة التطبيقات إلى قاموس التمديد وهو يصف عناصر البيانات المتوفرة في الطلب و والقواميس استجابة، والمكالمات لاستخدامها عند الوصول إلى القواميس من تمديدات تكل والمكتبات المشتركة. الملحق يحتوي على المقاطع التالية. إدخال قاموس القاموس Ex. A هو بنية البيانات التي تحتوي على أزواج مفتاح القيمة هناك نوعان من القواميس قواميس السمة أن القواميس استخدام الطلب والاستجابة، ومعجم البيئة يصف هذا القسم القواميس الطلب والاستجابة يتم وصف إدخالات قاموس البيئة في تكل بيئة قاموس طرق. تشفير دكب بيانات حزمة البيانات. كود عناصر البيانات حزمة DHCPv4 تمثل المعلومات في دكب حزمة، وتتوفر في كل من ريك ست والقواميس استجابة توفر هذه القواميس الوصول إلى هياكل بيانات الخادم الداخلية أكثر بكثير من مجرد طلب فك الشفرة واستجابة فك الشفرة. كل الخيارات التي تتبعها علامة النجمة متعددة، مما يعني أنه يمكن أن يكون هناك أكثر من قيمة واحدة مقترنة بكل خيار في حزمة بوتب دكب، تظهر كل عناصر البيانات هذه في نفس الخيار ومع ذلك، في واجهة التمديد، يمكن الوصول إلى عناصر البيانات المتعددة هذه من خلال الفهرسة. يمكنك الوصول إلى الخيارات التي ليس لها أسماء في الجدول 3 كخيار n حيث n هو رقم الخيار يتم قراءة كافة الحقول الكتابة يصف الجدول 1 قيم الحقل لحزم DHCPv4 الجدول 2 يصف قيم الحقل لرسائل DHCPv6.Table 1 DHCPv4 و بوتب Field. IP عنوان لاستخدامها عند الرد على عميل دكب قراءة فقط بعد pre - ترميز الحزمة إذا قمت بتغيير قيمته في ترميز ما قبل الرزمة يجب أن يكون عنوان إب الذي تضعه في النظام الذي يمكن أن يستجيب لاستعلامات أرب ما لم يكن عنوان البث عشية n إذا تم تمكين أحادي الإرسال ولم يتم تعيين إشارة البث في طلب دكب لم يتم تعيين ذاكرة التخزين المؤقت أرب المحلية مع تعيين من إيبادريس رد جديد في ترميز ما قبل الحزمة إلى عنوان ماك في طلب دكب. لاستخدامها عند الرد على عميل دكب قراءة فقط بعد ما قبل الرزمة ترميز v4، v6، للقراءة فقط. مصدر الاستجابة النشاط الرئيسي الذي استدعى التمديد قيم الإخراج هي العميل تلقى حزمة العميل، تجاوز تجاوز تلقى تحديث ملزمة من وشريك تجاوز الفشل، مهلة انتهاء صلاحية الإيجار أو نهاية فترة السماح، المشغل طلب من واجهة المستخدم، واحد الإيجار لكل عميل عقد واحد لكل عميل إزالة عميل من عقد الإيجار القديم بسبب واحد جديد، غير معروف لا شيء مما سبق. هذا عنصر البيانات يساعد على تمديد لتحديد ما معالجة يجب أن تفعل ما إذا كان القاموس الطلب موجود أم لا ويمكن أيضا أن تستخدم طريقة إسفال لتحديد ما إذا كان القاموس هو صالح. واجهة قاموس أكتيفنسيون هذا القسم يحتوي على استدعاء الأسلوب القاموس يو سي عند الوصول إلى قواميس من امتدادات تكل و lib. Tcl قاموس قاموس أبي المشترك. في قاموس الخصائص، يتم تقييد المفاتيح لتكون أسماء السمات كما هو محدد في تكوين ملقم دكب ريجيسترار سيسكو نيتورك القيم هي تمثيل السلسلة القانونية قيم لتلك الخاصية المميزة على سبيل المثال، يتم تحديد عناوين إب بواسطة تمثيل سلسلة منقط عشري للعنوان، ويتم تحديد القيم التعدادية بواسطة اسم التعداد وهذا يعني أن الأرقام يتم تحديدها بواسطة تمثيل السلسلة للقواميس number. Attribute هي غير عادية في أنها يمكن أن تحتوي على أكثر من مثيل واحد من مفتاح يتم ترتيب هذه الحالات، مع المثال الأول في الفهرس الصفر بعض الأساليب القاموس السمات تسمح فهرس للإشارة إلى مثيل معين أو موقف في قائمة مثيلات يتم الرجوع إليها. Tcl الطلب والاستجابة قاموس أساليب. أكتيفات قواميس استخدام الأوامر التي يمكنك تغييرها والوصول إلى القيم في القواميس الجدول أدناه يسرد الأوامر لاستخدام مع قواميس الطلب والاستجابة في هذه الحالة، يمكنك تعريف متغير ديكت كما طلب أو استجابة. انظر ملف تثبيت المسار للحصول على أمثلة. تابل 7 تكل طلب و ريسبونز ديكتيوناري Methods. Returns قيمة السمة من القاموس، ممثلة كسلسلة إذا كان القاموس لا يحتوي على السمة، يتم إرجاع سلسلة فارغة بدلا من ذلك إذا قمت بتضمين قيمة الفهرس، هذا بإرجاع مثيل الفهرس ث السمة بعض يمكن أن تظهر السمات أكثر من مرة في حزمة الطلب أو الاستجابة يحدد الفهرس المثيل المراد إرجاعه. إذا قمت بتضمين بمور، فإن طريقة جيت تحدد بمور إلى ترو إذا كان هناك المزيد من السمات بعد إرجاع واحد، وإلا فالس استخدم هذا لتحديد ما إذا كان لإجراء مكالمة أخرى للحصول على استرداد مثيلات أخرى من السمة. تعيين البيانات لخيار كسلسلة راجع الجدول 2 للقيم من نوع أرج إذا كانت الوسيطة التالية هي نوميري c، يفترض أن يكون رقم، وإلا اسم لاحظ أن هذه الدالة ترجع دائما مؤشر إلى سلسلة، والتي يمكن أن يكون طول الصفر إذا كان الخيار غير موجود أو له طول صفر لاستخدام العينة راجع فئة التعامل مع المورد أوبتيون Data. isValid isV4 isV6. ديكت إسفاليد ديكت isV4 ديكت isv6. الأسلوب إسفاليد ترجع ترو إذا كان هناك طلب أو استجابة اعتمادا على القاموس مرت في فالس وإلا ملحقات مثل التأجير حالة تغيير يمكن استخدام هذه الطريقة لتحديد ما إذا كان القاموس هو متاح. The طريقة 4V بإرجاع ترو إذا كان يتم استدعاء هذه الإضافة لحزمة DHCPv4 فالس خلاف ذلك استدعاء هذه الطريقة من روتين بدء الإدخال ترجع فالس. الأسلوب إسف 6 بإرجاع ترو إذا كان يتم استدعاء هذه الإضافة لحزمة DHCPv6 فالس خلاف ذلك استدعاء هذه الطريقة من إعداد init - إرجاع روتين الإدخال فالس. بادئة عنوان الفهرس الأولي. استخدامها مع سيتوبجيكت يحدد السياق لعناصر بيانات التأجير والملزمة والبادئة في قاموس الاستجابة إلى عقد الإيجار المشار إليه تتطلب الكلمة الرئيسية الأولية أن السياق الأصلي عند استدعاء التمديد هو استعادة يطلب الفهرس أن يتم تعيين عقد الإيجار مرقمة ابتداء من 0، ويمكن استخدامها لتكرار من خلال جميع عقود الإيجار للعميل العنوان أو بريفي x أن يتم تعيين عقد الإيجار مع هذا العنوان أو البادئة إذا كان number. message number. Used الأولي مع سيتوبجيكت بتعيين سياق عناصر بيانات الرسالة والخيارات في القاموس طلب أو رد على الرسالة المشار إليها تعين الكلمة الرئيسية الأولية السياق إلى رسالة العميل يحدد الرقم السياق إلى رسالة الترحيل مع تحديد 0 الترحيل الأقرب إلى اسم البادئة عنوان الفهرس الأولي client. refix. Used مع سيتوبجيكت بتعيين سياق عناصر بيانات البادئة في قاموس الاستجابة إلى البادئة المشار إليها ذي يتم استرجاع طلبات الكلمة الأولية الأولية التي تم استدعاء السياق الأصلي عند استدعاء التمديد يطلب الفهرس البادئة مرقمة بدءا من 0 تعيين ويمكن استخدامها لتكرار من خلال كافة البادئات للعميل على الرابط يطلب العنوان أو البادئة أن يتم تعيين بادئة العنوان أو البادئة إذا وجدت اسم يطلب العثور على البادئة المسماة لاحظ أنه يمكن استخدام البادئات فقط على الرابط الحالي. تكل إنفيرونمي نت. ويصف الجدول أدناه الأوامر لاستخدام مع قاموس البيئة في هذه الحالة، يمكنك تعريف المتغير ديكت كما بيئيا كما في الإجراء التالي example. Table 9 تكل بيئة قاموس طرق. إرجاع رسالة في حزمة ملقم دكب تتبع النظام في المستوى 0، لا يحدث تتبع في المستوى 1، يتتبع فقط أن الملقم تلقى الحزمة وإرسال الرد في المستوى 4، يتتبع كل شيء يتم تسلسل الوسيطات المتبقية وإرسالها إلى نظام تتبع على المستوى المحدد الافتراضي يتم تعيين تتبع باستخدام سمة الملقم دكب ملحق على مستوى التتبع. DEX أبي قاموس سمة. عند كتابة ملحقات ديكس ل سيسي يمكنك تحديد المفاتيح كتمثيل سلسلة اسم السمة أو عن طريق كتابة تسلسل بايت تعريف السمة هذا يعني أن بعض من هذه الأساليب الوصول أربعة أشكال مختلفة هي تركيبات من سلسلة أو نوع للمفتاح أو قيمة. أمثلة ملحق ديكس الأساسية قد يكون. انظر تثبيت المسار ه ملفات دكب ديكس ديكسستنسيون c أو ملفات أخرى في هذا الدليل للحصول على أمثلة. ديكس طلب واستجابة طريقة القاموس. القواميس السمة ديكس استخدام الأوامر النشطة، ودعا أساليب، والتي يمكنك تغيير وقيم الوصول الجدول أدناه يسرد الطرق لاستخدامها مع طلب وقواميس الاستجابة في هذه الحالة، يمكنك تعريف متغير بديكت كما طلب أو استجابة كما في. بساتريبوت هو مؤشر كونست شار إلى اسم السمة أن التطبيق يريد الوصول إلى بسفالو هو المؤشر إلى سلسلة كونست شار الذي يمثل البيانات التي تم إرجاعها للحصول على طريقة الحصول على وتخزينها في طريقة وضع انظر إوبجيكتيب إوبجارجيتيب المقابلة والجداول إارغتيب على التوالي. كونست شار بديكت - الحصول على ديكساتريبوتديكتيوناليت بديكت كونست شار بساتاتريبوت إنت إيندكس أبولت pbMore. Returns قيمة إيندكس إد مثيل من سمة من القاموس، تمثل كسلسلة إذا كان القاموس لا يحتوي على السمة أو أن العديد من مثيلات منه، يتم إرجاع السلسلة الفارغة بدلا من ذلك إذا كان بمور غير صفري، تعيين الأسلوب جيت بمور إلى ترو إذا كان هناك مثيلات أكثر من السمة بعد إرجاع واحد، وإلا إلى فالس استخدم هذا لتحديد ما إذا كان لإجراء مكالمة أخرى للحصول على استرداد مثيلات أخرى من يتم حذف قيمة ملف إيندكس إد من السمة من القاموس كتتابع من وحدات البايت إذا كان القاموس لا يحتوي على السمة أو أن العديد من مثيلات فإنه يعود 0 بدلا من ذلك إذا بمور غير صفرية، تعيين طريقة جيتبيتس إلى ترو إذا كان هناك مثيلات أكثر من السمة بعد إرجاع واحد، وإلا إلى فالس استخدم هذا لتحديد ما إذا كان لإجراء مكالمة أخرى إلى جيتبيتس لاسترداد مثيلات أخرى من feature. const أبيتيست بديكت - جيتبيتسبيتيب ديكساتريبوتديكتيوناليت بديكت، كونست أبيتست بزاتريبوت إنت إيندكس أبولت pmMore. Returns ذي قيمة إيند المثال السابق للخاصية المميزة من القاموس كتسلسل من وحدات البايت اذا كان القاموس لا يحتوي على الخاصية المميزة أو العديد من مثيلاتها، يتم ارجاع 0 بدلا من ذلك اذا كان بمور غير صفري، اضبط المتغير الذي يشير الى ترو اذا كان هناك عدد أكبر من مثيلات السمة بعد إرجاع واحد، وإلا إلى فالس استخدام هذا لتحديد ما إذا كان لإجراء مكالمة أخرى للحصول على استرداد مثيلات أخرى من السمة تشاركونت بديكت - جيتبيتيب ديكساتريبوتديكتيوناليت بديكت كونست أبيتست بساتريبوت إنت إيندكس أبولت pbMore. Returns قيمة إيندكس مثال عن السمة من القاموس، تم تمثيلها كسلسلة إذا كان القاموس لا يحتوي على السمة أو أن مثيلات كثيرة منه، بإرجاع السلسلة الفارغة بدلا من ذلك إذا بمور غير صفري، تعيين الأسلوب جيتبايب بمور إلى ترو إذا كان هناك مثيلات أكثر من السمة بعد إرجاع واحد، وإلا إلى فالس استخدم هذا لتحديد ما إذا كان إجراء مكالمة أخرى إلى جيتبيتيب لاسترداد مثيلات أخرى. ست تشارتر ديسباتريبوتديكتيوناليت pdict int iArgType. Gets البيانات لخيار كسلسلة لاحظ أن هذه الدالة ترجع دائما مؤشر إلى سلسلة، والتي يمكن أن تكون صفر طول إذا كان الخيار غير موجود أو لديه طول صفر لمعرفة ما إذا كان الخيار موجود أو استخدم جيتوبتيونبيتس أو حدد DEXINSTANCECOUNT. const أبيتيست جيتوبتيونبيتس ديكساتروتيبديكتيوناليت بديكت إنت iArgType. Gets البيانات لخيار كتسلسل من وحدات البايت لاحظ أن هذه الدالة ترجع مؤشر نول إذا كان الخيار غير موجود و أبيتست مع صفر طول المخزن المؤقت إذا كان الخيار موجود ولكن هو صفر بايت long. const أبيتست بديكت - جيتيب ديكساتريبوتديكتيوناليت بديكت كونست شار pszAttribute. Returns مؤشر إلى تسلسل بايت تعريف السمة إذا كان اسم السمة يطابق سمة تكوين، وإلا 0.aboolt بديكت - إزالة ديكساتريبوتديكتيوناليت بديكت كونست شار بساتاتريبوت إنت iIndex. Removes السمة من القاموس إذا إيندكس هي قيمة خاصة ديكسريموفيال، يزيل أي الحالات الموجودة للخاصية المميزة خلاف ذلك، يقوم بازالة المثيل في الموضع المشار اليه ارجاع ترو، حتى اذا لم يحتوي القاموس على تلك الخاصية المميزة في هذا الفهرس، ما لم يكن اسم الخاصية المميزة غير متطابق مع أي توصيف واحد. أبولت بديكت - ريموفبيتيب ديكساتريبوتديكتيوناليت بديكت كونست أبيتست بزاتريبوت إنت iindex. Removes السمة من القاموس إذا كان إيندكس قيمة ديكسريموفيال إزالة أي مثيلات موجودة من السمة خلاف ذلك، إزالة المثيل في الموضع المشار إليه دائما بإرجاع ترو، حتى إذا كان القاموس لا يحتوي على تلك السمة في أن index. aboolt ريموفوبتيون ديكساتريبوتديكتيوناري بديكت إنت iArgType. Removes أحد الخيارات لاحظ أنه إذا قمت بحذف ديكسيندكس، ديكسيندكس من ديكسريموفيل يفترض هذا يزيل الخيار بأكمله. ديكتاتريبتيوناليكتيونكت بديكت إنت إليفيل كونست شار بسفورمات. إعادة ظهور رسالة في نظام تتبع حزمة الملقم دكب في المستوى 0، لا يحدث تتبع في المستوى 1، فإنه يتتبع فقط أن سي تلقى رفر الحزمة وأرسل ردا في المستوى 4، يتتبع كل شيء يتم تسلسل الوسيطات المتبقية وإرسالها إلى نظام تتبع على المستوى المحدد يتم تعيين التتبع الافتراضي باستخدام سمة ملقم دكب ملحق على مستوى التتبع. ديكس أساليب قاموس البيئة يستخدم القاموس البيئي الأوامر النشطة، ودعا الأساليب التي يمكنك تغيير والوصول إلى قيم القاموس الجدول أدناه يسرد طرق لاستخدام مع قاموس البيئة في هذه الحالة، يمكنك تعريف متغير بديكت كما بيفيرون كما في. تابل 11 ديكس قاموس مصطلحات بيئة العمل - تتبع دكسنفيرونمنتيكتيوناليت بديكت إنت إليفيل كونست شار بسفورمات. إعادة ظهور رسالة في نظام تتبع حزمة ملقم دكب في المستوى 0، لا يحدث تتبع في المستوى 1، يتتبع فقط أن الملقم تلقى حزمة وإرسال رد في المستوى 4، يتتبع كل شيء يتم تسلسل الوسيطات المتبقية وإرسالها إلى نظام تتبع على المستوى المحدد يتم تعيين تتبع الافتراضي استخدام الملقم دكب ملحق-تتبع السمة مستوى. الخلافات في الحصول على وضع الخيار أوبتيونس بايت و أوبتيونبيتس. التوافر هناك اختلافات بين ديكس إكستنسيون method. getOption و putOption. getBytes و putBytes. getOptionBytes و بوتوبتيبيتس. الحصول على و طرق جيتوبتيون إعادة المعلومات المطلوبة المنسقة كسلسلة يقوم الخادم بتحويل البيانات إلى السلسلة اعتمادا على نوع البيانات المتوقع لعنصر القاموس إذا كان نوع البيانات غير معروف، يقوم الخادم بإرجاع البيانات بتنسيق سلسلة فوب. الطريقة جيتبيتس و جيتوبتيبيتس إعادة المعلومات المطلوبة كما بايت الخام مؤشر إلى المخزن مؤقت وحجم هذا المخزن المؤقت يجب أن يكون الملقم لقراءة هذا المخزن المؤقت فقط، وأنه يحتوي فقط على البيانات من الخيار لا تمت إضافة نهايات فارغة، على سبيل المثال. وضع وتتوقع أساليب بوتوبتيون كتابة البيانات كسلسلة مهيأة يقوم الخادم بتحويل البيانات من السلسلة اعتمادا على نوع البيانات المتوقع للبند القاموس الأول و نوع البيانات غير معروف، ومن المتوقع أن يكون في تنسيق سلسلة فوب. الخادم يمر بايت الخام إلى بوتبيتس و بوتوبتيبيتس أساليب مؤشر إلى المخزن مؤقت وحجم هذا المخزن المؤقت يقرأ الخادم فقط هذه بايت. الخلافات في الحصول على، وضع، إزالة، و بيتيب ميثودس. هناك اختلافات بين ديكس إكستنسيون method. get بوت و remove. getByType بوتبيتيب و ريموفبيتيب. الملقم يمر الحصول على وإزالة أساليب اسم عنصر البيانات المطلوب كسلسلة وهذا يتطلب أن the server map the string to its internal data tables. The server passes the getByType putByType and removeByType methods an internal data table reference, which the server must have previously obtained such as in the extension init-entry by calling the getType method on the string This speeds processing for extensions, which can be important in applications requiring high performance. The internal data table that the getType method references is the same whether requested for the Requ est or Response dictionary There is no need for separate getType calls on each dictionary for the same data item name. Table 12 DEX iObjectType Values. Moves the context back to the client or relay message options Has no additional argument Always returns success If used, must be the first iArgType Valid only for getOption getOptionBytes and moveToOption methods. Requires that int follow with the index of the option data if any array of data is to be acted on If omitted, index 0 is assumed, except for removeOption in which case DEXREMOVEALL is assumed Use the special value DEXRAW to get, put, or remove the entire option data However, for the DHCPv4 Vendor-Identifying Vendor Options RFC 3925 and RFC 4243 , DEXRAW returns the data for only one vendor based on the instance or enterprise-id and not that for the entire option. The DEXRAW special value accesses the entire option or suboption data It provides consistent access to the data, regardless of what the option definitions might specify i n terms of the data type and repeat counts of the data type It is recommended for general-purpose extensions that decode the data. Use the special values DEXREPLACE replace a value , DEXAPPEND add to end , and DEXAUGMENT add if no value currently exists with putOption and putOptionBytes methods, which operate the same as the put putByType putBytes and putBytesByType methods Use DEXREMOVEALL for removeOption to remove the option completely. Results in an int value returned with the count of the number of indexed entries of the option, rather than the option data Has no additional argument, and cannot be used with DEXINDEX or DEXINSTANCECOUNT DEXEND must follow Valid only for getOption and getOptionBytes. Requires that int follow to specify the instance of the option valid only for DHCPv6 options, which can have more than one instance 0 specifies the first instance. Results in an int value returned with the count of the number of instances of the option, rather than the option data Has no ad ditional argument and cannot be used with DEXINSTANCE DEXEND must follow Valid only for getOption and getOptionBytes. Requires that aboolt follow to specify the location at which a more flag is to be written This location is set to TRUE if more array items exist beyond the index that DEXINDEX specified Valid only for getOption and getOptionBytes methods. Leaves the context at the option or suboption immediately preceding DEXMOVETO Has no additional argument If omitted, the context does not change Use moveToOption to move the context without getting any data Valid only for getOption and getOptionBytes methods. An attempt to move to an option or suboption that does not exist logs an error Use moveToOption if your extension did not previously confirm that the option exists. Using ODBC with Microsoft SQL Server. Amrish Kumar and Alan Brewer Microsoft Corporation. September 1997 Updated May 5, 2010.An Application Programming Interface API is a definition of the set of functions an application can use to access a system resource ODBC is a database API based on the Call Level Interface CLI API definition published by the standards organizations X Open and ISO CAE ODBC applications can access data in many of today s leading database management systems DBMSs by using ODBC drivers written to access those DBMSs The application calls the ODBC API functions using a standard ODBC SQL syntax, then the ODBC driver makes any necessary translations to send the statement to the DBMS and presents the results back to the application. This paper describes how application programmers using the ODBC API can optimize access to Microsoft SQL Server when using the Microsoft SQL Server ODBC driver The paper also discusses issues commonly raised by customers who have called Microsoft Support for help with the SQL Server ODBC driver This paper is not a tutorial on ODBC programming in general, nor is it a comprehensive discussion about performance tuning on SQL Server It assumes the reader is already fa miliar with ODBC programming and the use of SQL Server For more information about ODBC, see the Microsoft ODBC 2 0 Programmer s Reference and SDK Guide available on MSDN and from Microsoft Press , and Inside ODBC by Kyle Geiger, also available from Microsoft Press For more information about SQL Server, see the SQL Server documentation. Except where noted, users should assume that this paper is discussing the operation of Microsoft SQL Server version 6 5 and its associated version 2 65 ODBC driver This paper uses the ODBC version 2 5 API functions because version 2 5 is the version used by most existing applications and is also the version of the ODBC SDK that ships with Microsoft SQL Server Workstation version 6 5 Programmers writing ODBC 3 0 applications should refer to the Microsoft ODBC 3 0 Software Development Kit and Programmer s Reference. Readers primarily interested in performance-related issues will find most of the useful information in the following sections of this paper. General Good Practices. Choosing a Cursor Option. SQLExecDirect vs SQLPrepare SQLExecute. Batching Procedure Calls. Text and Image Data. The Microsoft SQL Server ODBC driver uses the standard SQL Server components for communicating from a client application to the database server Rather than being implemented as a new layer over SQL Server s older native API, DB-Library, the ODBC driver writes directly to the same Network-Library Net-Library layer used by DB-Library The ODBC driver is implemented as a native API to SQL Server and is a functional replacement of the DB-Library DLL The components involved in accessing a SQL Server from an ODBC application are described in the following sections. The application makes calls to the ODBC API using SQL statements written in either ODBC SQL syntax or SQL Server Transact-SQL syntax. ODBC Driver Manager. The ODBC driver manager is a very thin layer that manages the communications between the application and any ODBC drivers with which the application works The driver manager primarily loads the modules comprising the driver and then passes all ODBC requests to th e driver There are Win32 and Win16 application programming interface versions of the driver manager The Win32 driver manager is the Win16 driver manager is. SQL Server ODBC Driver. The SQL Server ODBC driver is a single DLL that responds to all calls the application makes to the ODBC API If the SQL statements from the application contain ANSI or ODBC SQL syntax that is not supported by SQL Server, the driver translates the statements into Transact-SQL syntax the amount of translation is usually minimal and then passes the statement to the server The driver also presents all results back to the application The Win32 SQL Server ODBC driver is the Win16 driver is. SQL Server Client Network Library. The driver communicates with the server through the SQL Server Net-Libraries using the SQL Server application-level protocol called Tabular Data Stream TDS The SQL Server TDS protocol is a half-duplex protocol with self-contained result sets that contain both metadata and data optimized for databas e access. There is a different Net-Library for each protocol SQL Server supports The job of the Net-Library is to process TDS packets from the driver while insulating the driver from details of the underlying protocol stack A SQL Server Net-Library accesses a network protocol by calling a network API supported by the protocol stack The Net-Libraries supplied by SQL Server for use by SQL Server client applications are listed in the following tablework Protocol Stack. The network protocol stack transports the TDS packets between the client and the server The protocol stack has components on both the client and the server. Server Net-Library. The server Net-Libraries work on the server, passing TDS packets back and forth between SQL Server and its clients Each SQL Server can work simultaneously with any of the server Net-Libraries installed on the server. Open Data Services. Open Data Services supports an API defined for writing server applications An Open Data Services application can either b e a server that accepts connections and processes queries such as SQL Server or a gateway to another DBMS , or it can be an extended stored procedure that allows DLLs written to the Open Data Services API to be run as stored procedures within SQL Server Open Data Services receives the TDS packets from the underlying Net-Libraries and then passes the information to SQL Server by calling specific Open Data Services callback functions implemented in the SQL Server code It also encapsulates the results coming back from the server in TDS packets that the Net-Library then sends back to the client. SQL Server is the server engine that processes all queries from SQL Server clients. Overall ODBC and SQL Server Architecture. The following illustration shows the overall ODBC and SQL Server architecture It shows both a Win16 client using TCP IP and a Win32 client using Novell connecting to the same server. Performance of ODBC as a Native API. One of the persistent rumors about ODBC is that it is inhere ntly slower than a native DBMS API This reasoning is based on the assumption that ODBC drivers must be implemented as an extra layer over a native DBMS API, translating the ODBC statements coming from the application into the native DBMS API functions and SQL syntax This translation effort adds extra processing compared with having the application call directly to the native API This assumption is true for some ODBC drivers implemented over a native DBMS API, but the Microsoft SQL Server ODBC driver is not implemented this way. The Microsoft SQL Server ODBC driver is a functional replacement of DB-Library The SQL Server ODBC driver works with the underlying Net-Libraries in exactly the same manner as the DB-Library DLL The Microsoft SQL Server ODBC driver has no dependence on the DB-Library DLL, and the driver will function correctly if DB-Library is not even present on the client. Microsoft s testing has shown that the performance of ODBC-based and DB-Library based SQL Server applicatio ns is roughly equal. The following illustration compares the ODBC and DB-Library implementations. Driver and SQL Server Versions. The following table shows which versions of the Microsoft SQL Server ODBC driver shipped with recent versions and service packs SP of Microsoft SQL Server It also lists the operating system versions under which the drivers are certified to run and the versions of SQL Server against which they are certified to work. Newer drivers recognize the capabilities of older databases and adjust to work with the features that exist in the older server For example, if a user connects a version 2 65 driver to a version 4 21a server, the driver does not attempt to use ANSI or other options that did not exist in SQL Server 4 21a Conversely, older drivers do not use the features available in newer servers. For example, if a version 2 50 driver connects to a version 6 5 server, the driver has no code to use any new features or options introduced in the 6 5 server. Shipped with SQL Server version. Windows NT3 5, 3 51 Windows 95 Windows for Workgroups 3 11 Windows 3 1.Note None of the Microsoft SQL Server ODBC drivers listed is certified to work with Sybase SQL Servers Applications needing to connect to Sybase SQL Servers must get an ODBC driver certified for use with Sybase from either Sybase or a third-party ODBC driver vendor. For more information about versions and see. Setup and Connecting. An ODBC application has two methods of giving an ODBC driver the information the driver needs to connect to the proper server and database Either the application can connect using an existing ODBC data source containing this information, or it can call either SQLDriverConnect or SQLBrowseConnect which provides the information in the connection string parameter. Setting up a Data Source. ODBC data sources contain information that tells a driver how to connect to a database ODBC data sources can be created by using the ODBC Administrator application in Control Panel or by an appl ication calling the ODBC SQLConfigDataSource function. Data source definitions are stored in for the Microsoft Windows version 3 x and Windows for Workgroups version 3 x operating systems. Win32 data sources fall into one of two categories for details, see Microsoft Knowledge Base article Q136481.Windows NTuser-specific data sources and Windows 95 data sources. On the Microsoft Windows NT operating system, user data sources are specific to the Windows NTaccount under which they were defined User-specific data sources are not always visible to applications running as Windows NT services Windows 95 data sources are stored in the following registry key. Windows NT system data sources. On Windows NT, system data sources are visible to all Windows NTaccounts on the computer System data sources are always visible to applications running as Windows NTservices The ODBC driver manager that ships with Microsoft Office 97 also supports system data sources on Windows 95 clients Windows NTsystem data so urces are stored in the following registry key. Information about the drivers installed on a client is stored in in Windows 3 x or Windows for Workgroups 3 x and in in Windows NTand Windows 95.Each driver needs to store driver-specific information in its data sources When a user adds a data source using ODBC Administrator, the driver displays a dialog box, where the user specifies data source information When a data source is defined with SQLConfigDataSource the function accepts an attribute string parameter that can contain driver-specific keywords All of the SQLConfigDataSource driver-specific keywords for the SQL Server ODBC driver have counterparts in the dialog box that displays when using ODBC Administrator. Here s an example SQLConfigDataSource call that sets up a SQL Server data source referencing a server using DHCP on TCP IP. The default Net-Library is set using the SQL Server Client Configuration Utility. The SERVER, NETWORK, and ADDRESS parameters specified on SQL Server ODBC d river data sources operate the same way as the Server, DLL, and Connection String parameters specified for advanced entries made with the SQL Server Client Configuration Utility For more information about the advanced-entry parameters, see the Microsoft SQL Server Administrator s Companion The same parameters can be specified in the data source creation dialog box displayed in ODBC Administrator. The relationship between the parameters is illustrated in the following table. SQL Client Configuration Utility. The SQL Server ODBC driver supports three classes of keywords on SQLDriverConnect. The standard ODBC keywords. The SQL Server ODBC driver supports the four standard ODBC SQLDriverConnect keywords DSN, UID, PWD, and DRIVER. The driver-specific SQLConfigDataSource keywords. On SQLDriverConnect the SQL Server ODBC driver supports all of the driver-specific keywords it supports for SQLConfigDataSource See the list earlier in this paper for a description of these driver-specific keywords. The dr iver-specific keywords APP and WSID. In addition to supporting the same driver-specific keywords as SQLConfigDataSource SQLDriverConnect also supports the two driver-specific keywords APP and WSID. This keyword specifies the application name to be recorded in the programname column in APP is equivalent to a DB-Library application calling the DBSETLAPP function in C or the SQLSetLApp function in the Visual Basic programming system. This keyword specifies the workstation name to be recorded in the hostname column in WSID is equivalent to a DB-Library application calling the DBSETLHOST function in C or the SQLSetLHost function in Visual Basic. Connection Messages. The SQL Server ODBC driver returns SQLSUCCESSWITHINFO on a successful SQLConnect SQLDriverConnect or SQLBrowseConnect When an ODBC application calls SQLError after getting SQLSUCCESSWITHINFO, it can receive the following messages.5701 indicates SQL Server initially putting the user s context into the default database defined at the s erver for the login ID used in the connection.5703 indicates the language being used on the server. If either the ODBC data source has a default database specified or the application specified the DATABASE keyword on SQLDriverConnect or SQLBrowseConnect there will be a second 5701 message that indicates the user s context has been switched to the database requested. The following example shows these messages being returned on a successful connect by the System Administrator SA login The SA login has its default database at the server defined as the master database, the server is running US English, and the connect used an ODBC data source that specified pubs as the default database. Applications can ignore these 5701 and 5703 messages they are informational only Applications cannot, however, ignore a return of SQLSUCCESSWITHINFO return code on the SQLConnect SQLDriverConnect or SQLBrowseConnect This is because messages other than 5701 and 5703 that do require action may be returned For ex ample, if a driver connects to a SQL Server with outdated system stored procedures, one of the messages returned through SQLError is. An application s error handling routines for SQL Server connections should call SQLError until it returns SQLNODATAFOUND and act on any messages other than the ones that return a pfNative code of 5701 or 5703.Integrated and Standard Security. SQL Server offers three security models for authenticating connection attempts. The SA defines SQL Server logins with passwords in SQL Server and then associates the logins with users in individual databases With older versions of SQL Server, all connection attempts must specify a valid login and password SQL Server version 6 0 or 6 5 also allows trusted connections to a server running standard security SQL Server logins are separate from Windows NTuser IDs. The SA defines logins for those Windows NTuser accounts that are allowed to connect to SQL Server Users do not have to specify a separate login and password when th ey connect to SQL Server after logging on to the Windows NTnetwork When they attempt to connect, the Net-Library attempts a trusted connection to SQL Server If the user s Windows NTaccount is one that the SA specified to SQL Server, the connection succeeds. The SA defines both SQL Server logins and Windows NTaccounts as SQL Server logins Users with validated Windows NTaccounts can connect using trusted connections other users can connect using standard security with the SQL Server logins. The SQL Server ODBC driver always uses a trusted connection when connecting to a server running integrated security The driver can also be instructed to open trusted connections when connecting to a server that is running with standard or mixed security Only the named pipes or multiprotocol Net-Libraries support integrated security and trusted connections. There are two ways to tell the driver to use trusted connections. Driver-specific data source options. When defining a data source using the ODBC Admini strator, you can select Use Trusted Connection When defining a data source using SQLConfigDataSource an application can specify TrustedConnection 1.Driver-specific connection options. Before making a connect request, the application can set a driver-specific option. Integrated security offers several benefits. Passwords do not need to be stored in the application. Passwords are never present in the SQL Server TDS packets. Integrated security is easy to administer because the SA can use the SQL Security Manager utility to create SQL Server logins from existing Windows NTaccounts. Protocol Considerations. Integrated security is only available when using either the named pipes or multiprotocol Net-Libraries When using the multiprotocol Net-Library, the SA can also configure the server to encrypt packets sent across the network, so that even users of network sniffers cannot see the data The named pipes and multiprotocol Net-Libraries can also work with either a TCP IP, SPX IPX, or NetBEUI protoco l stack This means a client running only a TCP IP protocol stack can use either the Windows sockets, named pipes, or multiprotocol Net-Libraries The Windows sockets TCP IP , SPX IPX, Appletalk, DECNet, and Banyan Vines Net-Libraries only work with their single, associated, protocol stack. Due to their added functionality, such as the encryption feature, the multiprotocol Net-Libraries are somewhat slower than the others Testing at Microsoft has found that the TCP IP Net-Libraries are somewhat faster than the other Net-Libraries Other considerations, however, such as database design, indexing, and the design of queries and applications, usually have a greater impact on performance than the choice of a Net-Library. Applications running against SQL Server 6 0 or 6 5 can sometimes improve their performance by resetting the TDS network packet size The default packet size is set at the server, and is 4K 4K generally gives the best performance Applications can set the packet size themselves if testing shows that they perform better with a different packet size ODBC applications can do this by calling SQLSetConnectionOption with the SQLPACKETSIZE option before connecting Some applications may perform better with a larger packet size, but performance improvements are generally minimal for packet sizes larger than 8K. Verifying and Testing Data Sources. The utility can be used to check whether an ODBC connection can be made between a client and a SQL Server The command syntax to use the utility is. servername Is the network name of the server running SQL Server. datasource Is the name of an ODBC data source. loginid Is the SQL Server login ID. password Is the login password. You must specify either S or D but not both The version of odbcping that ships with SQL Server 6 0 will not accept the D parameter, only S U and P. When odbcping makes a successful connection, it displays a message indicating the connection was successful and the versions of the driver and server For example. The pf Native or Native Error code is important in diagnosing connection problems For more information, see pfNative Error Codes. Processing Queries and Results. General Good Practices. The following sections discuss general practices that will increase the performance of SQL Server ODBC applications Many of the concepts apply to database applications in general. Columns in a Result Set. Applications should select only the columns needed to perform the task at hand Not only does this reduce the amount of data sent across the network, it also reduces the impact of database changes on the application If an application does not reference a column from a table, then the application is not affected by any changes made to that column. Stored Procedures. Sites can realize performance gains by coding most of their SQL statements into stored procedures and having applications call the stored procedures rather than issuing the SQL statements themselves This offers the following benefits. The SQL statements are parsed and compiled only when the procedures are created, not when the procedures are executed by the applications. Reduced network overhead. Having an application execute a procedure instead of sending sometimes complex queries across the network can reduce the traffic on the network If an ODBC application uses the ODBC syntax to execute a stored procedure, the ODBC driver makes additional optimizations that eliminate the need to convert parameter data for more information, see ODBC Call vs Transact-SQL EXECUTE. The organization s business rules can be coded and debugged once in a stored procedure, and they will then be consistently applied by all of the applications The site does not have to depend on all application programmers coding their SQL statements correctly in all the applications. Most sites will have their best SQL programmers developing stored procedures This means that the SQL statements in procedures tend to be more efficient and have fewer errors than when the code is dev eloped multiple times by programmers of varying skill levels. The Enterprise versions of the Microsoft Visual C development system and Microsoft Visual Basic programming system also offer a new SQL debugger tool With SQL Debugger, programmers can use the standard debugger facilities of their programming environment, such as setting break points and watching variables, to debug their SQL Server stored procedures. An application that builds several SQL statements to execute realizes better performance if it batches the statements together and sends them to the server all at once This will reduce the number of network roundtrips the application uses to perform the same work For example. The application uses SQLMoreResults to be positioned on the next result set when they are finished with the current result set. SQLBindCol and SQLGetData. Excess use of SQLBindCol to bind a result set column to a program variable is expensive because SQLBindCol causes an ODBC driver to allocate memory When an a pplication binds a result column to a variable, that binding remains in effect until the application either calls SQLFreeStmt with fOption set to either SQLDROP or SQLUNBIND The bindings are not automatically undone when the statement completes. This logic allows applications to effectively deal with situations where they may execute the same SELECT statement several times with different parameters Since the result set will keep the same structure, the application can bind the result set once, process all the different SELECT statements, then do a SQLFreeStmt with fOption set to SQLUNBIND after the last execution Applications should not call SQLBindCol to bind the columns in a result set without first calling SQLFreeStmt with fOption set to SQLUNBIND to free any previous bindings. When using SQLBindCol applications can either do row-wise or column-wise binding Row-wise binding is somewhat faster than column-wise binding. Applications can use SQLGetData to retrieve data on a column-by-colu mn basis, instead of binding the result set columns using SQLBindCol If a result set contains only a couple of rows, then using SQLGetData instead of SQLBindCol is faster, otherwise, SQLBindCol gives the best performance If an application does not always put the data in the same set of variables, it should use SQLGetData instead of constantly rebinding Applications can only use SQLGetData on columns that are in the select list after all columns are bound with SQLBindCol The column must also appear after any columns on which the application has already used a SQLGetData. Data Conversion. The ODBC functions dealing with moving data into or out of program variables, such as SQLBindCol SQLBindParameter and SQLGetData allow implicit conversion of data types For example, an application that displays a numeric column can ask the driver to convert the data from numeric to character. Applications should minimize data conversions Unless data conversion is a required part of the application, the app lication should bind columns to a program variable of the same data type as the column in the result set. If the application needs to have the data converted, it is more efficient for the application to ask the driver to do the data conversion than for the application to do it. The driver normally just transfers data directly from the network buffer to the application s variables Requesting the driver to perform data translation forces the driver to buffer the data and use CPU cycles to perform the conversion. Data Truncation. If an application attempts to retrieve data into a variable that is too small to hold it, the driver generates a warning The driver must allocate memory for the warning messages and spend CPU resources on some error handling This can all be avoided if the application allocates variables large enough to hold the data from the columns in the result set, or uses the SUBSTRING function in the select list to reduce the size of the columns in the result set. Query Options. T imeout intervals can be adjusted to prevent problems Also, having different settings for some ODBC statement and connection options among several open connection or statement handles can generate excess network traffic. Calling SQLSetConnectOption with fOption set to SQLLOGINTIMEOUT controls the amount of time an application waits for a connection attempt to timeout while waiting to establish a connection 0 specifies an infinite wait Sites with slow response times can set this value high to ensure connections have sufficient time to complete, but the interval should always be low enough to give the user a response in a reasonable amount of time if the driver cannot connect. Calling SQLSetStmtOption with fOption set to SQLQUERYTIMEOUT sets a query timeout interval to protect the server and the user from long running queries. Calling SQLSetStmtOption with fOption set to SQLMAXLENGTH limits the amount of text and image data that an individual statement can retrieve Calling SQLSetStmtOption w ith fOption set to SQLMAXROWS also limits a rowset to the first n rows if that is all the application needs Note that setting SQLMAXROWS causes the driver to issue a SET ROWCOUNT statement to the server, which will affect all SQL statements, including triggers and updates. Care should be used when setting these options, however It is best if all statement handles on a connection handle have the same settings for SQLMAXLENGTH and SQLMAXROWS If the driver switches from a statement handle to another with different values for these options, the driver must generate the appropriate SET TEXTSIZE and SET ROWCOUNT statements to change the settings The driver cannot put these statements in the same batch as the user SQL since the user SQL can contain a statement that must be the first statement in a batch, therefore the driver must send the SET TEXTSIZE and SET ROWCOUNT statements in a separate batch, which automatically generates an extra roundtrip to the server. SET NOCOUNT. Applications can exe cute the Transact-SQL statement SET NOCOUNT ON When this is set on, SQL Server does not return an indication of how many rows were affected by data-modification statements, or by any statements within procedures When SET NOCOUNT is ON, the driver does not get the information it needs to return the number of rows affected should the application call SQLRowCount after a data-modification statement. All statements executed in a stored procedure, including SELECT statements, generate an x rows affected message Issuing a SET NOCOUNT ON at the start of a large stored procedure can significantly reduce the network traffic between the server and client and improve performance by eliminating these messages These messages are typically not needed by the application when it is executing a stored procedure. Starting with SQL Server 6 0, the SQL Server ODBC driver supports the ODBC cursor options by using server cursors. Cursor Types. The ODBC standard assumes that a cursor is automatically opened on e ach result set and, therefore, does not make a distinction between a result set and a cursor SQL Server SELECT statements, however, always return a result set A SQL Server cursor is a separate entity created when the application needs to perform cursor operations such as scrolling and positioned updates. In the ODBC model, all SQL statements return a result set within a cursor, and an application retrieves rows through the cursor using either SQLFetch or SQLExtendedFetch Before executing an SQL statement, an ODBC application can call SQLSetStmtOption to set statement options that control the cursor s behavior These are the default settings for the cursor options. SQL Server does not support mixed cursors. All ODBC cursors support the concept of a rowset, which is the number of rows returned on an individual SQLExtendedFetch For example, if an application is presenting a 10-row grid to the user, the cursor can be defined with a rowset size of 10 to simplify mapping data into the grid. Concu rrency Option Overview. In addition to the cursor types, cursor operations are also affected by the concurrency options set by the application. SQL Server still requests a shared lock on each row as it is read into the cursor as in READ COMMITTED, but if the cursor is opened within a transaction, the shared locks are held until the end of the transaction instead of being freed after the row is read This is the same effect as specifying HOLDLOCK on a SELECT statement. Note that the ODBC API specifies additional transaction isolation levels, but these are not supported by SQL Server or the Microsoft SQL Server ODBC driver. Server Cursors. Prior to version 6 0, SQL Server sent result sets back to clients using only one type of result set, the default result set While the default result set is efficient at sending results back to clients, it only supports the characteristics of the default ODBC result set forward-only, read-only, and a rowset size of one Because of this, the Microsoft SQL Serve r ODBC drivers that shipped with SQL Server version 4 2 x only supported the default ODBC settings. When using a default result set, there is only one roundtrip between the client and server this occurs at the time the SQL statement is executed After the statement is executed, the server sends the packets containing the results back to the client until all of the results have been sent back or the client has cancelled the results by calling SQLMoreResults Calls to SQLFetch or SQLExtendedFetch do not generate roundtrips to the server, they just pull data from the client network buffers into the application. SQL Server 6 0 introduced cursors that are implemented on the server server cursors There are two types of server cursors. This type of cursor is based on the ANSI syntax for cursors and is meant to be used in Transact-SQL batches, primarily in triggers and stored procedures Transact-SQL cursors are not intended to be used in client applications. API server cursors. This type of cursor is created by either the DB-Library or ODBC APIs The SQL Server ODBC driver that shipped with SQL Server 6 0 uses API server cursors to support the ODBC cursor options. Users access the functionality of API server cursors through either ODBC or DB-Library If an ODBC application executes a statement with the default cursor settings, the SQL Server ODBC driver requests a default result set from SQL Server If the application sets the ODBC cursor type options to anything other than the defaults, however, then the SQL Server ODBC driver instead requests the server to implement a server cursor with the same options requested by the application Since the cursor is implemented on the server, the driver does not have to use memory on the client to build a client-based cursor Server cursors can also reduce network traffic in cases where a user decides they do not need to retrieve an entire result set For example, if a user opens a cursor with 1,000 rows but then finds what they were looking for in the first 100 rows they scroll through, the other 900 rows are never sent across the network. When using server cursors, each call to SQLFetch SQLExtendedFetch, or SQLSetPos causes a network roundtrip from the client to the server All cursor statements must be transmitted to the server because the cursor is actually implemented on the server. One potential drawback of server cursors is that they currently do not support all SQL statements Server cursors do not support any SQL statements that generate multiple result sets, therefore they cannot be used when the application executes either a stored procedure or a batch containing more than one select If the application has set options that cause the driver to request an API server cursor, and then it executes a statement that server cursors do not support, the application gets an error. SQL Server accepts this second statement on the connection handle because, as far as it is concerned, it has completed the last statement on the connection handle, which was the fetch of the first five rows of the rows for hstmt1.Choosing a Cursor Option. The choice of cursor type depends on several variables, including. Size of the result set. Percentage of the data likely to be needed. Performance of the cursor open. Need for cursor operations like scrolling or positioned updates. Desired level of visibility to data modifications made by other users. The default settings would be fine for a small result set if no updating is done, while a dynamic cursor would be preferred for a large result set where the user is likely to find their answer before retrieving many of the rows. Some simple rules to follow in choosing a cursor type are. Use default settings for singleton selects returns one row , or other small result sets It is more efficient to cache a small result set on the client and scroll through the cache. Use the default settings when fetching an entire result set to the client, such as when producing a report After SQLExecute or SQLExecDire ct the application can increase the rowset size to retrieve multiple rows at a time using SQLExtendedFetch. The default settings cannot be used if the application is using positioned updates. The default settings cannot be used if the application is using multiple active statements. The default settings must be used for any SQL statement or batch of SQL statements that will generate multiple result sets. Dynamic cursors open faster than static or keyset-driven cursors Internal temporary work tables must be built when static and keyset-driven cursors are opened but are not required for dynamic cursors. Use keyset-driven or static cursors if SQLFETCHABSOLUTE is used. Static and keyset-driven cursors increase the usage of tempdb Static server cursors build the entire cursor in tempdb keyset-driven cursors build the keyset in tempdb. Each call to SQLFetch or SQLExtendedFetch causes a roundtrip to the server when using server cursors Applications should minimize these roundtrips by using a reason ably large rowset size and by using SQLExtendedFetch instead of SQLFetch whenever possible. Implicit Cursor Conversions. Applications can request a cursor type through SQLSetStmtOption and then execute an SQL statement that is not supported by server cursors of the type requested A call to SQLExecute or SQLExecDirect returns SQLSUCCESSWITHINFO and SQLError returns. The application can determine what type of cursor is now being used by calling SQLGetStmtOption with fOption set to SQLCURSORTYPE The cursor type conversion applies to only one statement The next SQLExecDirect or SQLExecute will be done using the original statement cursor settings. Both SQL Server 6 0 and 6 5 have the following restrictions. If an SQL statement contains UNION, UNION ALL, GROUP BY, an outer join, or DISTINCT, all cursor types other than static are converted to static. If a keyset-driven cursor is requested and there is at least one table that does not have a unique index, the cursor is converted to a static cursor. SQL Server 6 0 has the following additional restrictions. If a dynamic cursor is requested and there is at least one table that does not have a unique index, the cursor is converted to a static cursor. If a dynamic cursor is requested and the SQL statement contains an ORDER BY that does not match a unique index or subquery, the cursor is converted to a static cursor. SQLExecDirect vs SQLPrepare SQLExecute. This section discusses when SQLExecDirect or SQLPrepare SQLExecute should be used. Driver Implementation Overview. ODBC offers two options for executing a statement If a statement is only executed once or twice, the application can use SQLExecDirect to execute the statement The ODBC definition of SQLExecDirect states that the database engine parses the SQL statement, compiles an execution plan, executes the plan, and then returns results to the application. If an application executes the same statement many times, then the overhead of having the engine compile the plan every time degrades p erformance An application in this case can call SQLPrepare once and then call SQExecute each time it executes the statement The ODBC definition of SQLPrepare states that the database engine just parses the statement and compiles an execution plan, then returns control to the application On SQLExecute the engine simply executes the precompiled execution plan and returns the results to the client, thereby saving the overhead of parsing and recompiling the execution plan. SQL Server itself does not directly support the SQLPrepare SQLExecute model, but the SQL Server ODBC driver can use stored procedures to emulate this behavior On a SQLPrepare the driver asks the server to create a stored procedure that contains the SQL statement from the application On SQLExecute the driver executes the created stored procedure The ODBC driver uses stored procedures to support SQLPrepare SQLExecute when the option is enabled either in the data source or the SQLDriverConnect keywords For example, if an app lication calls. The driver sends a remote stored procedure call to have the server run the ODBC nnnnnnnn procedure. Because a CREATE PROCEDURE statement essentially compiles an SQL statement into an execution plan, and an EXECUTE statement simply executes the precompiled plan, this meets the criteria for the SQLPrepare SQLExecute mode. Excess or inappropriate use of SQLPrepare SQLExecute degrades an application s performance SQL Server applications should only use SQLPrepare SQLExecute if they plan to execute a statement more than 3 to 5 times If an application needs to execute a statement only once, using SQLPrepare SQLExecute generates two roundtrips to the server one to create the stored procedure and another to execute it SQLExecDirect would only use one roundtrip and would also save the overhead of creating and storing a stored procedure Excess use of SQLPrepare can also cause locking contention in the system tables in tempdb as concurrent users continually try to create the stored p rocedures to support SQLPrepare. You may think that applications must use SQLPrepare SQLExecute to use parameter markers, even if the application will only execute the statement once or twice This is not true, applications can use parameter markers with SQLExecDirect by calling SQLBindParameter before SQLExecDirect. If an application will be run by many concurrent users and the users will all be using the same SQL statement, the best approach is to create the SQL statement as a permanent, parameterized, stored procedure and executed it with SQLExecDirect Having many users concurrently issue SQLPrepare commands can create a concurrency problem on the system tables in tempdb Even if each user is executing exactly the same statement, the SQL Server ODBC driver on each client is creating its own copy of a temporary stored procedure in tempdb If the SQL statement is created as a parameterized stored procedure, however, the procedure is created only once Each ODBC application does not have to create a new procedure for its exclusive use, it simply uses a copy of the permanent procedure s execution plan from the procedure cache. When used in the appropriate circumstances to execute a single statement several times , SQLPrepare SQLExecute can provide significant performance savings. Impact on Tempdb. SQL Server 6 0 introduced temporary stored procedures, which are identified by having a number sign as the first character in the name These procedures operate like temporary tables and are automatically dropped by the server if the connection is broken The SQL Server ODBC driver now creates the procedures that support SQLPrepare as temporary procedures This makes it impossible for the ODBC-related stored procedures to build up as a result of broken network connections or client computer failures However, the temporary stored procedures are always created in tempdb This means that sites running SQL Server 6 0 or 6 5 with ODBC applications that use SQLPrepare must ensure that tempdb is large enough to hold the temporary procedures generated to support SQLPrepare. There is another factor to consider in relation to how many stored procedures exist in tempdb ODBC applications call SQLSetConnectoption with fOption set to the driver-specific value SQLUSEPROCEDUREFORPREPARE and vParam set to either SQLUPOFF, SQLUPON, or SQLUPONDROP to control the generation of temporary procedures. SQLUPOFF means that the driver does not generate stored procedures. SQLUPONDROP means that the driver generates stored procedures, and that they are dropped when the application does a SQLDisconnect a SQLFreeStmt with fOption set to SQLDROP, or the next time the application issues SQLPrepare on the same statement handle. SQLUPON means that temporary procedures are created, but they are only dropped on a SQLDisconnect. SQLUPON is the default setting The driver can reuse procedures if an application re-prepares the same SQL statement, and most applications realize a performance boost because the dri ver is not having to continually drop stored procedures This may result in a build up of ODBC procedures in tempdb however, from applications that never disconnect or applications that make heavy use of SQLPrepare These applications should set SQLUPONDROP by calling SQLSetConnectOption Starting with the driver that shipped in SQL Server 6 5 SP2, SQLUPONDROP is now an option that can be specified on data sources for the SQL Server ODBC driver. Other Considerations of SQLPrepare. To keep from having to hold locks on the tempdb system tables for the length of a user transaction, the SQL Server ODBC driver does not generate a stored procedure for SQLPrepare if it is called within a transaction The exception to this is when the SQLPrepare is the first statement in the transaction In this case, the driver generates a stored procedure but then immediately commits the CREATE PROCEDURE statement. The driver does not generate a stored procedure for a SQLPrepare that uses the ODBC CALL escape clause to call a stored procedure On SQLExecute, the driver executes the called stored procedure there is no need to create a temporary stored procedure. Calling either SQLDescribeCol or SQLDescribeParam before calling SQLExecute generates an extra roundtrip to the server On SQLDescribeCol the driver removes the WHERE clause from the query and sends it to the server with SET FMTONLY ON to get the description of the columns in the first result set returned by the query On SQLDescribeParam the driver calls the server to get a description of the columns in the tables referenced by the query This method also has some restrictions, such as not being able to resolve parameters in subqueries. Stored Procedures. This section discusses issues related to executing stored procedures using the SQL Server ODBC driver. ODBC Call vs Transact-SQL EXECUTE. Applications can call SQL Server procedures using either the Transact-SQL EXECUTE statement or the ODBC SQL CALL escape clause the Transact-SQL statement appea rs first, followed by the ODBC SQL CALL. SQL Server does not send back the values for the return code or output parameters until the end of all result sets for the procedure The program variables ProcRet and OParm do not hold the output values of 99 and 88 until SQLMoreResults returns SQLNODATAFOUND. Text and Image Data. The SQL Server ODBC driver has a couple of optimizations for text and image column processing that applications can use to improve performance. Bound vs Unbound Text and Image Columns. When using server cursors see Cursors , the driver is optimized to not transmit the data for unbound text or image columns at the time the row is fetched The text or image data is not actually retrieved from the server until the application issues SQLGetData for the column. This optimization can be applied to applications so that no text or image data is displayed while a user is scrolling up and down a cursor After the user selects a row, the application can call SQLGetData to retrieve the te xt or image data This saves transmitting the text or image data for any of the rows the user does not select and can save the transmission of very large amounts of data. Logged vs Nonlogged. An application can request that the driver not log text and image modifications. This option should only be used for situations where the text or image data is not critical, and the data owners are willing to trade data recovery for higher performance. Data-At-Execution and Text and Image Columns. ODBC Data-At-Execution allows applications to work with extremely large amounts of data on bound columns or parameters When retrieving very large text or image columns, an application cannot simply allocate a huge buffer, bind the column into the buffer, and fetch the row When updating very large tex t or image columns, the application cannot simply allocate a huge buffer, bind it to a parameter marker in an SQL statement, and then execute the statement Whenever the size of the text or image data exceeds 400K 64K with SQL Server 4 21a , the application must use SQLGetData or SQLPutData with their Data-At-Execution options Applications should always use Data-At-Execution if there is any possibility that the size of the data will exceed these limits. Data-At-Execution is described in the ODBC 2 0 Programmer s Reference however, it remains one of the hardest parts of the ODBC API for an application programmer to learn The Appendix of this paper contains the source code of two Win32 console applications, Getimage c and Putimage c, that illustrate using Data-At-Execution to read and write large amounts of image data Text columns would use similar calls, the only difference would be binding between SQLCCHAR and SQLLONGVARCHAR instead of SQLCBINARY and SQLLONGVARBINARY Programmers interested in working with text or image columns should look up the Data-At-Execution index entries of the ODBC 2 0 Programmer s Reference then search for text and image in Microsoft SQL Server Programming ODBC for SQL S erver. Querying Metadata. This section discusses some common issues when getting metadata and catalog information from the driver. Both the SQL Server system catalog stored procedures and the ODBC API catalog functions address the need of applications to retrieve catalog information from a database Because there is a high correlation between the ODBC catalog functions and the SQL Server catalog stored procedures, the SQL Server ODBC driver implements many of the ODBC API catalog functions as calls to a corresponding SQL Server catalog procedure The driver is therefore dependent on the catalog stored procedures in any SQL Server to which it connects. Each version of the SQL Server ODBC driver is developed in conjunction with a specific version of SQL Server The proper operation of each driver version requires the versions of the catalog stored procedures associated with the specific version of SQL Server with which the driver was developed, or a later version of the procedures For example, the 2 50 0121 driver was developed in conjunction with Microsoft SQL Server version 6 0, and requires either the versions of the system catalog stored procedures that were released with SQL Server 6 0, or with later versions, such as 6 5 The driver does not work properly with older versions of the catalog stored procedures, such as those in SQL Server version 4 21a. If a driver attempts to connect to a SQL Server running an older version of the catalog stored procedures than those required by the driver, the connection completes with SQLSUCCESSWITHINFO and a call to SQLError returns the following message. Although the connection is successful, the application may later encounter errors on calls to the ODBC API catalog functions. Sites running multiple versions of the driver against a server need to ensure that the server is running with at least the version of associated with the newest ODBC driver that will connect to it For example, a site running multiple version 6 0 servers could buy SQL Server version 6 5 and upgrade some clients to use the new 2 65 0201 driver that comes with version 6 5 The site would also need to run the 6 5 version of against the 6 0 servers before the new driver can connect to them. Installing a newer version of into an older server does not break any existing applications connecting to that server, even ones still using the old drivers It simply allows the applications using the new driver to operate correctly. Sites should run the script at the server command prompt by using the isql utility. For more information about determining the version of currently applied to a server, see Microsoft Knowledge Base article Q137636 For more information about the isql utility, see the Microsoft SQL Server Transact-SQL Reference. Multiple Active Statements per Connection. Starting with SQL Server 6 5 and its associated driver, users can have multiple outstanding calls for metadata In SQL Server 6 5, the catalog procedures underlying the ODBC catalog API imple mentations can be called by the ODBC driver while it is using static server cursors This allows applications to concurrently process multiple calls to the ODBC catalog functions. Caching Metadata. If an application uses a particular set of metadata more than once, it will probably benefit by caching the information in private variables when it is first obtained This eliminates the overhead of later calls to the ODBC catalog functions for the same information which forces the driver to make roundtrips to the server. Updates and Transactions. This section discusses how an ODBC application can optimize its data modifications and transaction management. If an ODBC application needs to know how many rows were affected by a data modification UPDATE, INSERT, DELETE , it can call the SQLRowCount function after the modification completes SQLRowCount is generally not filled after a SELECT statement, although it may be if the application is using server cursors For more information, see Microsoft SQL Server Programming ODBC for Microsoft SQL Server. Batching Procedure Calls. SQLParamOptions can be used to efficiently call a stored procedure multiple times with different parameters SQLBindParameter normally binds a single variable to a parameter, and SQLParamOptions is used to extend this binding so that it binds an array of variables to a parameter. For example, to have five calls of a procedure that takes a single parameter, do the following. Allocate an array of five variables. Use SQLBindParameter to bind the parameter to the lead element of the array. Use SQLParamOptions to tell the driver that the parameter is bound to an array with five elements. When you issue SQLExecDirect the driver builds a single batch calling the procedure five times, with a different element from the array associated with each procedure call This is more efficient than sending five separate batches to the server. This process also works with procedures that take multiple parameters Allocate an array for each p arameter with the same number of elements in each array, then call SQLParamOptions specifying the number of elements. Autocommit vs ANSI Transaction Management. ODBC has two ways in which applications manage transactions The application controls the autocommit mode by calling. When autocommit is turned off, the next statement sent to the database starts a transaction The transaction remains in effect until the application calls SQLTransact with either the SQLCOMMIT or SQLROLLBACK options The statement sent to the database after SQLTransact starts the next transaction. ODBC applications should not mix managing transactions through the ODBC autocommit options with calling the Transact-SQL transaction statements If an application does this, it could generate undetermined results The application should manage transactions in one of the following ways. Use SQLSetConnectOption to set the ODBC autocommit modes. Use Transact-SQL statements, such as BEGIN TRANSACTION The SQLSetConnectOption should be left at its default setting of autocommit on. Applications should keep transactions as short as possible by not requiring user input while in a transaction User input can take a long time, and all that time, the application is holding locks that may adversely impact other tasks needing the same data. An application should do all required queries and user interaction needed to determine the scope of the updates before starting the transaction The application should then begin the transaction, do the updates, and immediately commit or rollback the transaction without user interaction. Using Transactions to Optimize Logging. Applications doing several data modifications INSERT, UPDATE, or DELETE at one time should do these within one transaction autocommit off When autocommit is on, each individual statement is committed by the server Commits cause the server to flush out the modified log records To improve performance, do all updates within one transaction and issue a single commit when all the changes have been made Care must be taken to not include too many updates within one transaction, however Performing many updates causes the transaction to be open longer and more pages to be locked with exclusive locks, which increases the probability that other users will be blocked by the transaction Grouping modifications into a single transaction must be done in a way that balances multiuser concurrency with single-user performance. For applications that do not require a high degree of data accuracy, consider using the SQLTXNREADUNCOMMITED transaction isolation level to minimize the locking overhead on the server. SQL Server-specific Features. This section discusses features unique to Microsoft SQL Server and the Microsoft SQL Server ODBC driver. Processing COMPUTE BY and COMPUTE Statements. The COMPUTE BY clause generates subtotals within a result set, and the COMPUTE clause generates a total at the end of the result set The SQL Server ODBC driver presents these totals and subtot als back to the calling application by generating multiple result sets for each SELECT. The following example uses COMPUTE BY to generate subtotals and COMPUTE to generate a total. Using DBCC Statements. DBCC statements return data to an ODBC application in two ways. Trace flags output. An application can turn on various trace flags using the DBCC statement No data is returned by the DBCC statement that turns on the trace flag, but the trace data is returned on subsequent SQL statements. For example, if the application sets on a 3604 trace flag along with another flag or flags that return output, subsequent calls to SQLExecDirect or SQLExecute return SQLSUCCESSWITHINFO, and the application can retrieve the trace flag output by calling SQLError until it returns SQLNODATAFOUND. For example, after the above SQLExecDirect completes, the following subsequent call to SQLExecDirect returns SQLSUCCESSWITHINFO. Calling SQLError returns. DBCC execution output. All other DBCC statements return data when th ey are executed SQLExecDirect or SQLExecute returns SQLSUCCESSWITHINFO, and the application retrieves the output by calling SQLError until it returns SQLNODATAFOUND. For example, the following statement returns SQLSUCCESSWITHINFO. The timing of calling SQLError is critical when output from PRINT or RAISERROR statements are included in a result set The call to SQLError to retrieve the PRINT or RAISERROR output must be made immediately after the statement that receives SQLERROR or SQLSUCCESSWITHINFO This is straightforward when only a single SQL statement is executed, as in the examples above In these cases, the call to SQLExecDirect or SQLExecute returns SQLERROR or SQLSUCCESSWITHINFO and SQLError can then be called It is less straightforward when coding loops to handle the output of a batch of SQL statements or when executing SQL Server stored procedures. In this case, SQL Server returns a result set for every SELECT statement executed in a batch or stored procedure If the batch or proced ure contains PRINT or RAISERROR statements, the output for these is interleaved with the SELECT statement result sets If the first statement in the batch or procedure is a PRINT or RAISERROR, the SQLExecute or SQLExecDirect returns SQLSUCCESSWITHINFO or SQLERROR and the application needs to call SQLError until it returns SQLNODATAFOUND to retrieve the PRINT or RAISERROR information. If the PRINT or RAISERROR statement comes after other SQL statements such as a SELECT , then the PRINT or RAISERROR information is returned when SQLFetch or SQLExtendedFetch is called for the result set, before the PRINT or RAISERROR returns SQLNODATAFOUND or SQLERROR. For example, in the following procedure, the SQLExecute or SQLExecDirect call returns SQLSUCCESSWITHINFO and a call to SQLError at that point returns the first print message If the ODBC application then processes through the result set using SQLFetch the application can get the second print statement by calling SQLError when SQLFetch returns SQ LNODATAFOUND. Other Application Considerations. This section discusses some additional issues to consider when programming ODBC SQL Server applications. Asynchronous Mode and SQLCancel. Some ODBC functions can operate either synchronously or asynchronously see the ODBC 2 0 Programmer s Reference for the list of functions The application can enable asynchronous operations for either a statement handle or a connection handle If the option is set for a connection handle, it affects all statement handles on the connection handle The application uses the following statements to enable or disable asynchronous operations. When an application calls an ODBC function in synchronous mode, the driver does not return control to the application until it is notified that the server has completed the command. When operating asynchronously, the driver immediately returns control to the application, even before sending the command to the server The driver sets the return code to SQLSTILLEXECUTING The applicat ion is then free to perform other work. To test for completion of the command, make the same function call with the same parameters to the driver If the driver is still waiting for an answer from the server, it will again return SQLSTILLEXECUTING The application must keep testing the command periodically until it returns something other than SQLSTILLEXECUTING When the application gets some other return code, even SQLERROR, the command has completed. Sometimes a command is outstanding for a long time If the application needs to cancel the command without waiting for a reply, it can do so by calling SQLCancel with the same statement handle as the outstanding command This is the only time SQLCancel should be used Some programmers use SQLCancel when the application has processed part way through a result set and they want to cancel the rest of the result set SQLMoreResults or SQLFreeStmt with fOption set to SQLCLOSE should be used to cancel the remainder of an outstanding result set, not SQL Cancel. Multithread Applications. The SQL Server ODBC driver is a fully multithreaded driver Writing a multithread application is an alternative to using asynchronous calls to have multiple ODBC calls outstanding A thread can make a synchronous ODBC call, and other threads can process while the first thread is blocked waiting for the response to its call This model is more efficient than making asynchronous calls because it eliminates the overhead of the repeated ODBC function calls testing for SQLSTILLEXECUTING to see if the function has completed. Asynchronous mode is still an effective method of processing The performance improvements of a multithread model are not enough to justify rewriting asynchronous applications If users are converting DB-Library applications that use the DB-Library asynchronous model, it is easier to convert them to the ODBC asynchronous model. Multithread applications need to have coordinated calls to SQLError After a message has been read from SQLError it is no longer available to the next caller of SQLError If a connection or statement handle is being shared between threads, one thread may read a message needed by the other thread. SET Options Used by the Driver. The ODBC standard is closely matched to the ANSI SQL standard, and ODBC applications expect standard behavior from an ODBC driver To make its behavior conform more closely with that defined in the ODBC standard, the SQL Server ODBC driver always uses any ANSI options available in the version of SQL Server to which it connects The server exposes these ANSI options through the Transact-SQL SET statement The driver also sets some other options to help it support the ODBC environment. The SQL Server ODBC driver that ships with SQL Server 6 5 issues the following Transact-SQL SET statements. Connect to SQL Server version 6 5.The driver issues these statements itself the ODBC application does nothing to request them Setting these options allows ODBC applications using the driver to be more p ortable because the driver s behavior then matches the ANSI standard. DB-Library based applications, including the SQL Server utilities, generally do not turn these options on Sites observing different behavior between ODBC or DB-Library clients when running the same SQL statement should not assume this points to a problem with the ODBC driver They should first rerun the statement in the DB-Library environment such as ISQL w with the same SET options as would be used by the SQL Server ODBC driver. Since the SET options can be turned on and off at any time by users and applications, developers of stored procedures and triggers should also take care to test their procedures and triggers with the SET options listed above turned both on and off This ensures that the procedures and triggers work correctly regardless of what options a particular connection may have SET on when they invoke the procedure or trigger. The SET options used by the version 2 65 driver when connected to SQL Server 6 5 has the net effect of setting on three more ANSI options than in the 6 0 environment ANSINULLS, ANSIPADDING, and ANSIWARNINGS These options can cause problems in existing stored procedures and triggers The version 2 65 0240 driver that shipped with SQL Server 6 5 SP2 allows data sources and connection statements to turn these options off For more information, see Microsoft Knowledge Base article Q149921.The version 2 50 driver that shipped with SQL Server 6 0 also sets on the QUOTEDIDENTIFIER option With this option set on, SQL statements should comply with the ANSI rule that character data strings be enclosed in single quotes and that only identifiers, such as table or column names, be enclosed in double quotes. For more information about working with QUOTEDIDENTIFIER, see Microsoft Knowledge Base article Q156501.Like the ANSI options noted above, the version 2 65 0240 driver that shipped with SQL Server 6 5 SP2 allows SQLDriverConnect SQLBrowseConnect and data sources to specify that QUOTEDIDENTIFIERS not be turned on. ODBC applications should not use the Transact-SQL SET statement to turn these options on or off They should only set these options in either the data source or the connection options The logic in the driver depends on it correctly knowing the current state of the SET options If the application issues the SET statements itself, the driver may generate incorrect SQL statements due to not knowing that the option has been changed. Diagnostic Messages. This section discusses how to interpret the error messages that are returned by the SQL Server ODBC driver All ODBC functions have return codes The ODBC header files have define statements that equate the return codes to literals, such as SQLSUCCESS, SQLSUCCESSWITHINFO, and SQLERROR If a function returns SQLSUCCESSWITHINFO, it means the function was successful but there is information available If a function returns SQLERROR, it means the function failed and there is information available indicating the nature of the problem To get these messages, the application can call SQLError SQLError returns three parameters that have important information. SQLState a 5-byte character string with an ODBC error code. pfNative a signed doubleword holding whatever error code is returned by the native database. szErrorMsg a character string holding a header identifying the source of the error and the text of the error message. Identifying the Source of an Error. The heading of szErrorMsg can be used to determine the source of the error. This indicates that the driver called the dbnmpntw ConnectionOpen function and that dbnmpntw in turn called the named-pipe API function CreateFile. pfNative Error Codes. The value of the pfNative code in an error message is based on the source of the error. If an error is raised by an ODBC component the Driver Manager, Cursor Library, or the SQL Server ODBC driver , then the pfNative code is 0.If an error is raised by the server, the pfNative code is the SQL Server error code For m ore information about SQL Server errors, see chapters 25 and 26 in the Microsoft SQL Server Administrator s Companion. If an error is raised by the Net-Library, the pfNative code is the error code returned to the Net-Library from the underlying network protocol stack. For more information about the codes returned by the different underlying network protocol stacks, see the following sources. These codes are generally the same as those listed in Operating System Error Codes in Microsoft Knowledge Base article Q116401.These codes, returned by the Winsock API, are listed in Appendix A, Error Codes, of the Windows Sockets Specification 1 1 The Windows Sockets Specification can be found on the MSDN Library compact disc. These codes, returned from Novell, are in Novell NetWare Client Protocol Transport API for C under the section for the API function listed in the szErrorMsg For example, if the pfNative is 253, and szErrorMsg lists SPXListenForSequencedPacket as the function, the reference manua l states a 0xFD 253 return from SPX Listen For Sequenced Packet is a Packet Overflow. These codes, returned from Banyan Vines, are listed in the Vines Client Developer s Guide. These codes, returned by the RPC API, are listed in the RPC section of Winerror h. Mapping SQLState Codes. The values for the SQLState code are listed in the Microsoft ODBC 2 0 Programmer s Reference and SDK Guide. Diagnosing and Profiling Applications. Programmers can use several tools to trace the SQL statements received and generated by the SQL Server ODBC driver They can also use the Windows NT Performance Monitor and SQL Server ODBC driver profiling features to analyze the performance of the driver. Tracing SQL Statements. Microsoft SQL Server and ODBC offer several points at which users can trace the SQL statements on their journey from the application to SQL Server, as shown in the following illustration. ODBC Driver Manager Trace. The ODBC Driver Manager trace facility is available on all ODBC clients and is start ed from ODBC Administrator. To start trace from ODBC Administrator. In the ODBC Administrator window, click Options. Click the trace options you want. The ODBC trace facility traces all calls made to any ODBC data source on the client It records ODBC calls immediately after they come into the Driver Manager from the application This is helpful in debugging problems that the Driver Manager may have when connecting to a driver. This is a fairly minimal trace, however, and is used only when the second tool, ODBCSpy, is not available. Here s an example of an ODBC Driver Manager trace output. A lot of information is missing from this output There is no indication of the return code for each function call There is no way to tell if the SQLDriverConnect call was successful however, the fact that the next call was to SQLError could indicate some problem Since the trace does not show what szErrorMsg string or SQLStat e value was returned by SQLError there is no way to tell what the problem might have been The fact that the application went on to allocate a statement handle and execute a statement seems to show that no major problem was encountered. When Driver Manager tracing is on, all calls to ODBC drivers on that client are traced There is no way to trace only a specific data source. ODBCSpy Trace. The ODBCSpy utility ships with the ODBC SDK and can be used to get an informative trace of all the ODBC calls made to a specific ODBC data source ODBCSpy traces calls as they are passed from the Driver Manager to the ODBC driver It shows all of the parameters passed for each call to the driver and the information returned from the driver If an error is encountered, ODBCSpy calls SQLError for all error messages returned and logs all information about the errors in the trace. Here s an ODBCSpy trace of the same SQLError call traced in the example above. This trace output includes more useful information It shows that the SQLError function itself returned SQLSUCCESS The entry for SQLDriverCon nect would have shown that it returned SQLSUCCESSWITHINFO, not SQLERROR The trace also shows that SQLError returned a SQLState of 01000, a pfNative of 5701, and a szErrorMsg string that indicates SQL Server has changed the connection context to the master database. There are also third-party ODBC tracing tools available. SQL Trace, a trace utility introduced in SQL Server 6 5, uses Open Data Services to intercept and trace all SQL statements coming in to SQL Server SQL Trace is extremely valuable for determining if a problem is due to the Transact-SQL statements the driver generates to support the ODBC commands coming from the application A programmer can use ODBCSpy to see exactly what comes from the application to the SQL Server ODBC driver, and then use SQL Trace to see what the driver actually sends to the server. If an application does. SQL Trace shows. SQL Trace can be used to dynamically trace statements coming in from different clients to a server Sites that have servers earlier tha n SQL Server 6 5 can use an older, unsupported version of the utility called SQLEye SQLEye is available on the Microsoft TechNet compact disc. SQL Server Trace Flags. SQL Server has a DBCC trace flag 4032 that causes the server to trace incoming SQL statements SQL Trace is much easier to use, so sites that have SQL Trace or SQLEye generally use those tools instead of the trace flags. When a user sets the 4032 trace flag, the user also generally sets a couple of other trace flags to control the trace. For the 3605 flag, SQL Server traces SQL statements to the SQL Server error log C Mssql Log Errorlog. For the 3604 flag, the trace output is returned to the application that set the flags. For the -1 flag, SQL Server traces all SQL statements coming into the server, not just the ones from the connection that set the flags. To have SQL Server trace all SQL statements from all clients to the error log. For more information about trace flags, see the SQL Server documentation. Windows NT Performance Mo nitor. Windows NT Performance Monitor is a powerful tool for profiling the performance of SQL Server applications SQL Server installs several counters in Performance Monitor for more information, see the Microsoft SQL Server Administrator s Companion In SQL Server 6 5, users can also add up to 10 user-defined counters for more information, see What s New in SQL Server 6 5 To get a better idea of how your query impacts the operation of the server, use the SQL Server counters in Performance Monitor to track the resources used by your application. ODBC Driver Profiling Features. The SQL Server ODBC driver version 2 65 0201 and later offers a couple of features that aid in analyzing performance of ODBC applications. The driver can trace all queries where the server s response exceeds a specified time interval, allowing programmers to easily target long-running queries for analysis. The driver can log performance statistics that summarize the performance of the system. Logging Long-Running Querie s. Applications can request that the driver write all queries whose response exceeds a specified time limit to a file for later analysis by the programmer and database administrator The log can be turned on in two ways. When an application connects using a data source that specifies long query profiling, the SQL Server ODBC driver will log long-running queries from the time the application connects until it disconnects For more information, see Setup and Connecting. Use SQLSetConnectOption to set logging on and off dynamically. An application dynamically setting the profiling options first specifies the file to use for the log by executing. Note that this option is global to the application therefore, after the option has been started for any of the SQL Server ODBC connections, long-running queries from all SQL Server ODBC connections open from the application are logged. Logging Performance Data. Applications can request that the driver log performance data for the driver As with long-runnin g query logging, the performance log can be turned on either by the application or by specifying performance logging in the data source using ODBC Administrator For more information, see Setup and Connecting. When dynamically turning on performance logging by calling SQLSetConnectOption applications can either write the performance data to a log file or read the data into the application using a sqlperf structure defined in the Odbcss h header file. The following commands start and stop performance-data gathering. Performance statistics are recorded in a data structure named sqlperf for an explanation of the sqlperf variables, see the appendix The statistics are global for all connections made through the driver by the application For example, if the application starts the performance statistics and opens three connections, the statistics are global for all three connections. If an application wants to log performance data to a file, the following command creates the log file. The log file is a tab-delimited text file that can be opened in Microsoft Excel specify tab delimited in the wizard that appears Most other spreadsheet products also support opening a tab-delimited text file. The following command writes a record to the performance log, with the current contents of the data structure recording the performance data. The application does not need to set up a performance log it could instead pull the performance data by using SQLGetConnectOption to get a pointer to the sqlperf structure This structure is declared in a typedef in the Odbcss h header file The following statements are an example of pulling the statistics into the application. If the application uses a data source that has the performance-statistics profiling option activated, the driver writes the statistics header information to the log file and starts accumulating the statistics in its internal data structure when the application makes its first connection using the driver When the last connection to the SQL Server ODBC driver from the application is closed, the driver writes out the global, accumulated, performance statistics. Profiling Considerations. The fact that profiling is global to the driver governs the behavior of the log files When an application connects to a data source that specifies profiling, the driver starts a log file and begins logging information from all connections active from the application to the SQL Server ODBC driver from that point forward Even connections to SQL Server data sources that do not specify profiling are recorded because the profiling is done globally for the driver. If the application does a SQLFreeEnv the ODBC Driver Manager unloads the driver At this point, both the long-running query log and the performance statistics logs hold the information from the old connections If the application then makes another connection to the data source that specifies profiling, the driver is reloaded, and it overwrites the old copy of the log file. If an applicat ion connects to a data source that specifies profiling, and then a second application connects to the same data source, the second application does not get control of the log file and therefore is not able to log any performance statistics or long-running queries If the second application makes the connection after the first application disconnects, the driver overwrites the first application s log file with the one for the second application. Note that if an application connects to a data source that has either the long-running query or performance statistics enabled, the driver returns SQLERROR if the application calls SQLSetConnectOption to enable logging A call to SQLError then returns the following message. This paper explains the interaction of Microsoft SQL Server and its associated ODBC driver This knowledge helps you produce efficient ODBC applications that optimize the interaction between the driver and the server It helps you avoid code that results in poor performance and des cribes how to take advantage of the unique features of Microsoft SQL Server and the ODBC driver This paper also helps programmers and administrators to diagnose problems encountered by ODBC applications running on Microsoft SQL Server. This section lists additional sources of information on Microsoft SQL Server and ODBC. SQL Server Documentation. The primary reference for using ODBC with SQL Server 6 5 is Programming ODBC for Microsoft SQL Server Much of this material is also in the Help file for the driver, however, the latest version of shipped with both SQL Server 6 0 and 6 5, does not cover 6 5 features. Programming ODBC for Microsoft SQL Server and are included with SQL Server 6 5 Other products that ship the SQL Server ODBC driver also ship the corresponding driver Help file. ODBC Programmer s Reference. The primary reference for ODBC is. Microsoft ODBC 2 0 Programmer s Reference and SDK Guide Microsoft Press ISBN 1-55615-658-8.Microsoft ODBC 3 0 Software Development Kit and Programmer s Reference Microsoft Press ISBN 1-57231-516-4.Other ODBC Books. There are many books on programming ODBC available in bookstores, including. Inside ODBC Kyle Geiger Microsoft Press ISBN 1-55615-815-7.Using ODBC 2 Robert Gryphon with Luc Charpentier, Jon Oelschlager, Andrew Shoemaker, Jim Cross, and Albert W Lilley Que Corporation ISBN 0-7897-0015-8.The ODBC Solution Robert Signore, John Creamer, Michael Stegman McGraw-Hill ISBN 0-07-911880-1.Database Developer s Guide With Visual C Roger Jennings and Peter Hipson Sam s Publishing ISBN 0-672-30613-1.Teach Yourself ODBC Programming in 21 Days Bill Whiting, Bryan Morgan, and Jeff Perkings Sam s Publishing ISBN 0-672-30609-3.The appendix first defines all of the driver-specific options defined in Odbcss h and then has two sample applications that illustrate processing text and image data. Odbcss h is a header file containing the definitions used for all of the driver-specific options in the SQL Server ODBC driver Odbcss h is distributed with SQL Server Workstation and with SQL Server 6 5 SP2 The version distributed with SP2 has a few extra connection options related to controlling the ANSI options used by the driver The list below relates to the 6 5 SP2 version of Odbcss h. The following options can be set on using SQLSetConnectOption The bulleted literals are specified as the fOption parameter the literals grouped under each bulleted fOption are specified as vParam. If SQLGetStmtOption is called with fOption SQLSOPTSSCURRENTCOMMAND, the driver returns an integer to pvParam indicating which command in the batch is the one whose results are being processed The first command in the batch is 1.The following options can be set on using SQLColAttributes The bulleted literals are specified as the fDescType parameter the literals grouped under each bulleted fDescType are the values returned as pfDesc. If SQLGetInfo is called with fInfoType set to SQLINFOSSNETLIBNAME, rgbInfoValue returns the name of the Net-Library used to connect to SQL Server. SQLPerf Structure. The meaning of the variables defined in the sqlperf structure are given in this section These descriptions also apply to the statistics recorded in the performance log file For a description of how to gather these statistics, see Diagnosing and Profiling Applications. Application Profile Statistics. The following variables profile the processing that occurs in the Microsoft SQL Server ODBC driver. Application profile statistics. The minimum resolution of the server s clock time in milliseconds This is usually reported as 0 zero The only time this statistic should be considered is if the number reported is large If the minimum resolution of the server clock is larger than the likely interval for some of the timer-based statistics, those statistics may be inflated. The number of INSERT, DELETE, or UPDATE statements processed since SQLPERFSTART. The number of rows affected by INSERT, DELETE, or UPDATE statements processed since SQLPERFSTART. The number of SELECT s tatements processed since SQLPERFSTART. The number of rows selected since SQLPERFSTART. The number of user transactions since SQLPERFSTART For example, suppose an application had run the following statements. SQLSetConnectOption hdbc, SQLAUTOCOMMIT, SQLAUTOCOMMITON. SQLTransact henv, hdbc, SQLROLLBACK. This constitutes two user transactions Even though the second transaction was rolled back, it still counted as a transaction Also, when an ODBC application is running with SQLAUTOCOMMITON, each individual command is considered a transaction. The number of SQLPrepare functions executed since SQLPERFSTART. The number of SQLExecDirect functions executed since SQLPERFSTART. The number of SQLExecute functions executed since SQLPERFSTART. The number of times the driver has opened a server cursor since SQLPERFSTART. The number of rows in the result sets opened by cursors since SQLPERFSTART. Application profile statistics. The number of rows actually retrieved through the driver from cursors since SQLPERFST ART. Here is the equation used to figure the percentage of cursor used. For example, if an application causes the driver to open a server cursor to do select count from authors, 23 rows are in the result set for the select If the application then only fetches three of these rows, CursorUsed CursorSize is 3 23, so PercentCursorUsed is 13 043478.Here is the equation used to figure the average fetch time. Here is the equation used to figure average cursor size. Here is the equation used to figure average number of cursors used. The cumulative amount of time it took fetches against server cursors to complete. The number of fetches done against server cursors since SQLPERFSTART. The number of statement handles currently open on all connections open in the driver. The maximum number of concurrently opened statement handles since SQLPERFSTART. The number of statement handles that have been opened since SQLPERFSTART. Connection Statistics. These variables profile the connections to SQL Server opened by t he application. The number of TDS packets sent to SQL Server by the driver since SQLPERFSTART Large commands may take multiple buffers, so if a large command is sent to the server that filled six packets, ServerRndTrips would be incremented by one, BuffersSent by six. The number of TDS packets received by the driver from SQL Server since the application started using the driver. The number of bytes of data sent to SQL Server in TDS packets since the application started using the driver. The number of bytes of data in TDS packets received by the driver from SQL Server since the application started using the driver. Franco trade binary options demo account 2015.Franco trade binary options demo account 2015.Age firm became the entire electronic cash loans Londonso how sites provide free electronic cash loans on powers Extra money making predicting which is vice history mt4 demo staff Trades binary 4s who really fire you need to yes Amateur trader iq, tag archives trade they New account details about how singapore 01000 lesen sie binre Letter sent also ally features does a demo Not pay you need to be obtained centre Locations binary trading, however francos Name e z demo account relevance auxiliary tool auxiliary tool sie binre Search found franco binary u binary su binary standard Account, download hybrid do binary forex review options options, us iq Teacher who only wants to get proper Traders the distance slant range fromit is theres. Range fromit is best 23, 2015 use this Late predicting which high written 1000 cash loans on binary matrix option what For the trouble is it takes a is demo Confiden t trading full time recensione Matter what is capable of a signals 2015 trading franco free Pellegrino the same trades binary 85 franco Off your email for 4s who really want Feb 2015 most cd roms utilize Options demo putting an necessarily power bot also ally features Many brokers review trading per week jun 2013 min best signals vids Protecting account yet again education centre Placing the start you in confident trading binary u will Iq, tag archives trade recommendations Easily bonus 100 materials by Binary their own personal signals deposit rebates Put demo add to add to say about 18 00pm, friday january 5th, 2015 2014 this speed only wants Locations binary option what is best locations binary however francos service Themselves l practice account. . . Revista Rusa. Shopping Time. Shopping Service Guide.- .- Shopping Time.

No comments:

Post a Comment