تخطي إلى المحتوى الرئيسي
الدعم
تسجيل الدخول باستخدام حساب Microsoft
تسجيل الدخول أو إنشاء حساب.
مرحباً،
تحديد استخدام حساب مختلف!
لديك حسابات متعددة
اختر الحساب الذي تريد تسجيل الدخول باستخدامه.

ملخص تناقش هذه المقالة كيفية إنشاء جداول SQL


Microsoft Business Solutions - برامج رائعة تستند إلى السهول.


مزيد من المعلومات استخدم الجداول SQL لإنشاء جداول موجودة في برنامج طرف ثالث مدمج مكتوب

بلغة الدهارة. تغطي هذه الخطوات أيضا كيفية منح SQL هذه الجداول.


ملاحظة يستبدل هذا الأسلوب أسلوب amAutoGrant الموضح في الفصل 41 من دليل المبرمجين المهارة، المجلد 1.

1. قم بإنشاء إجراء عام يسمى بدء التشغيل إذا لم يكن أحدها موجودا بالفعل
في برنامج جهة خارجية. يتم تشغيل هذا البرنامج النصي عند بدء تشغيل "السهول العظمى" وعادة ما يكون المكان الذي يتم فيه تسجيل المشغلات.


2. في البرنامج النصي لبدء التشغيل، قم بإنشاء مشغل إجراء على
Add_Successful_Login_Record باستخدام التعليمات البرمجية التالية.

{Name: Startup}
local integer l_result;
l_result = Trigger_RegisterProcedure(script Add_Successful_Login_Record, TRIGGER_AFTER_ORIGINAL, script gp_create_tables);
if l_result <> SY_NOERR then
warning "The Add_Successful_Login_Record trigger is not registered.";
end if;



3. سيتصل المشغل المسجل الذي تم إنشاؤه في الخطوة 2 بالإجراء gp_create_tables عندما يسجل المستخدم دخوله
إلى Microsoft Dynamics GP. يتم تشغيل هذا الإجراء عند فتح شركة Great Plains أولا أو عند تبديل المستخدم أو الشركة.


4. إنشاء الإجراء العام المسمى
gp_create_tables. سينشئ هذا البرنامج النصي الجداول لبرنامج جهة خارجية في قاعدة البيانات SQL Server الصحيح. كما سيتم إنشاء الجدول الذي تم إنشاؤه في storedprocedures (zDP procs) ومنح SQL الأذونات إلى الجدول والإجراءات. استخدم التعليمات البرمجية التالية.

{Name: gp_create_tables} 
local boolean result,l_result,OUT_Access;
{if logged in as sa, let them create the tables}
if 'SQLSaUser' of globals then
OUT_Access = true;
else
{This else statement will work only on 8.0. If logged in as a user other than sa,
but they have table access permissions, let them create the tables}
if syUserInRole('User ID' of globals, ROLE_SYSADMIN) or (syUserIsDBO ('User ID' of globals, 'Intercompany ID' of globals)
and syUserIsDBO ('User ID' of globals, SQL_SYSTEM_DBNAME)) then
OUT_Access = true;
end if;
end if;

if 'SQL Server' of globals > 0 and OUT_Access then
{enable table creation mode}
result = Table_SetCreateMode(true);
{Do not display any table errors to the user.}
result = Table_DisableErrorChecks(true);
{accessing the table creates it, list all your tables here, make sure to close the tables when done}
get first table GPSetup; {Purchasing series table}
close table GPSetup;
get first table GPSetup2; {System series table}
close table GPSetup2; {now set permissions, call once for the table and once for the stored procs}
{GPSetup is a purchasing series table so that will be in the company dbo}
l_result = GrantAccess(physicalname(table GPSetup),false,"DYNGRP",'Intercompany ID' of globals)
of form 'SQL Maintenance';
l_result = GrantAccess(physicalname(table GPSetup),true,"DYNGRP",'Intercompany ID' of globals)
of form 'SQL Maintenance';
{GPSetup2 is a system series table so that will be in the DYNAMICS database}
l_result = GrantAccess(physicalname(table GPSetup2),false,"DYNGRP","DYNAMICS") of form 'SQL Maintenance';
l_result = GrantAccess(physicalname(table GPSetup2),true,"DYNGRP","DYNAMICS") of form 'SQL Maintenance';
{Turn off automatic table creation.}
result = Table_SetCreateMode(false);
{Turn table error reporting back on.}
result = Table_DisableErrorChecks(false);
end if;


5. سيتم إنشاء الجداول والإجراءات المخزنة التي تم إنشاؤها في SQL Server SQL سيتم منحها. سيتم تشغيل هذا البرنامج النصي لمستخدمي DYNSA أو DYNSA فقط وبعد إنشاء الجداول، لا بأس في تشغيل هذا البرنامج النصي مرة أخرى.

كانت هذه المقالة TechKnowledge Document ID:33429

TechKnowledge Content

هل تحتاج إلى مزيد من المساعدة؟

الخروج من الخيارات إضافية؟

استكشف مزايا الاشتراك، واستعرض الدورات التدريبية، وتعرف على كيفية تأمين جهازك، والمزيد.

تساعدك المجتمعات على طرح الأسئلة والإجابة عليها، وتقديم الملاحظات، وسماعها من الخبراء ذوي الاطلاع الواسع.

هل كانت المعلومات مفيدة؟

ما مدى رضاك عن جودة اللغة؟
ما الذي أثّر في تجربتك؟
بالضغط على "إرسال"، سيتم استخدام ملاحظاتك لتحسين منتجات Microsoft وخدماتها. سيتمكن مسؤول تكنولوجيا المعلومات لديك من جمع هذه البيانات. بيان الخصوصية.

نشكرك على ملاحظاتك!

×