PDA

View Full Version : سوال: generate scripts function of database با کدنویسی



fatemeh_67
سه شنبه 12 دی 1391, 10:51 صبح
باسلام من با کدنویسی script تمام جداول را ایجاد کردم
اما تابع هایم را هنوز نتوانستم کد زیر را نوشتم اما

foreach (UserDefinedFunction myfunc in myAdventureWorks.UserDefinedFunctions)

{


/* Generating IF EXISTS and DROP command for tables */


StringCollection funcScripts = myfunc.Script(scriptOptions);


//foreach (string script in tableScripts)


// scrs += script;


/* Generating CREATE TABLE command */

funcScripts = myfunc.Script();


foreach (string script in funcScripts)

fnScr +=
" " + script;

}
اما خطامیده
'CREATE FUNCTION' must be the first statement in a query batch.