c#Æô¶¯Sql Server·þÎñ
³ÌÐòÆô¶¯Sql ServerÆäʵºÜ¼òµ¥
´úÂ룺
System.ServiceProcess.ServiceController myController =
new System.ServiceProcess.ServiceController("MSSQL$ACCP4444"); //·þÎñÃû³Æ ÕÒÁ˰ëÌì²ÅÕÒµ½£¬±¿ËÀÎÒÍêÁË¡£ÔÚ·þÎñÉÏÓÒ¼üÊôÐÔ£¬ÄÜ¿´µ½
if (myController.CanStop)
{ }
else
{
myController.Start();
}
//×¢ ÐèÒªÒýÓà System.ServiceProcess ÔÚÏîÄ¿->Ìí¼ÓÒýÓÃ->ÄÜÕÒµ½Õâ¸öÒýÓá£
Ïà¹ØÎĵµ£º
CREATE PROCEDURE [dbo].[PUB_CORP_SEARCH]
@oi_return INT OUTPUT , ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
namespace MyDbTest
{
class Program
{
static void Main(string[] args)
{
SqlConnection thisConnection = new SqlConnection(
@ ......
1.¼¤»îSQL¸ú×Ù
´Óoracle10gÒÔºóÌṩÁËÐµķ½·¨¼¤»îSQLµÄ¸ú×Ù£¬¼´ÊÇʹÓÃdbms_monitor°üÀ´¿ªÆô»ò¹Ø±ÕSQL¸ú×Ù¡£
֮ǰ¾É·½·¨ÊÇʹÓà alter session set events .. »òÕßʹÓÃdbms_system.set_ev·½Ê½
ʹÓÃdbms_monitor°ü¿ÉÒÔÔڻỰ£¬¿Í»§¶Ë£¬×é¼þÒÔ¼°Êý¾Ý¿âËĸö²ã¼¶¿ªÆôSQLµÄ¸ú×Ù¡ ......
Student(S#,Sname,Sage,Ssex) ѧÉú±í
Course(C#,Cname,T#) ¿Î³Ì±í
SC(S#,C#,score) ³É¼¨±í
Teacher(T#,Tname) ½Ìʦ±í
ÎÊÌ⣺
1¡¢²éѯ“001”¿Î³Ì±È“002”¿Î³Ì³É¼¨¸ßµÄËùÓÐѧÉúµÄѧºÅ£»
select a.S# from (select s#,score from SC where C#='001') a,(select s#,score
fr ......
&nbs ......