Á¬½Óms sqlÊý¾Ý¿âд·¨
windows ¼¯³ÉÑéÖ¤£º
<connectionStrings>
<add name="ConnectionStr" connectionString="Data Source=CAIPENG-PC;database=Test;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
</connectionStrings>
»òÕß
<connectionStrings>
<add name="ConnectionStr" connectionString="Data Source=CAIPENG-PC;Initial Catalog=Test;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
»ìºÏÑéÖ¤£º
<connectionStrings>
<add name="ConnectionStr" connectionString="Data Source=CAIPENG-PC;Initial Catalog=Test;uid=sa;pwd=caipeng" providerName="System.Data.SqlClient"/>
</connectionStrings>
È¡ConnectionStr£º
string conn=System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStr"].ConnectionString;
Ïà¹ØÎĵµ£º
SELECT ID,TITLE,
(SELECT TIMES from CLS_COURSE WHERE CLS_COURSE.ID=CLS_CLASS.COURSEID) AS TIMES,
(SELECT CASE WHEN EXISTS(SELECT * from CLS_ATDC WHERE CLS_ATDC.CLSID=CLS_CLASS.ID ) THEN (SELECT TOP 1 COURSETIME from CLS_ATDC WHERE CLS_ATDC.CLSID=CLS_CLASS.ID ORDER BY COURSETIME DESC) ELSE 0 ......
´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì£¬ÀàËÆÓÚʼþº¯Êý£¬SQL Server™ ÔÊÐíΪ Insert¡¢Update¡¢Delete ´´½¨´¥·¢Æ÷£¬¼´µ±ÔÚ±íÖвåÈë¡¢¸üС¢É¾³ý¼Ç¼ʱ£¬´¥·¢Ò»¸ö»òһϵÁÐ T-SQLÓï¾ä¡£
´¥·¢Æ÷¿ÉÒÔÔÚ²éѯ·ÖÎöÆ÷Àï´´½¨£¬Ò²¿ÉÒÔÔÚ±íÃûÉϵãÓÒ¼ü->“ËùÓÐÈÎÎñ”->“¹ÜÀí´¥·¢Æ÷”À´´´½¨£¬²»¹ý¶¼ÊÇҪд T-SQL ......
×ªÔØËµÃ÷£º¸øÕýÔÚ×öϵͳºÍÏë×öϵͳµÄÈË£¬SQL²©´ó¾«ÉÄãÃÇ»áÓõ½µÄ¡£——mAysWINd
Ò»¸öÌâÄ¿Éæ¼°µ½µÄ50¸öSqlÓï¾ä
Student(S#,Sname,Sage,Ssex) ѧÉú±í
Course(C#,Cname,T#) ¿Î³Ì±í
SC(S#,C#,score) ³É¼¨±í
Teacher(T#,Tname) ½Ìʦ±í
ÎÊÌ⣺
1¡¢²éѯ“001”¿Î³Ì±È“002”¿Î³Ì³É¼¨¸ßµ ......
--µÚÒ»²½
--ÔÚmaster¿âÖн¨Á¢Ò»¸ö±¸·ÝÊý¾Ý¿âµÄ´æ´¢¹ý³Ì.
USE master
GO
CREATE PROC p
@db_name sysname, --Êý¾Ý¿âÃû
@bk_path NVARCHAR(1024) --±¸·ÝÎļþµÄ·¾¶
A ......
(1) Connect to the Analysis server, select the database which we want it to be automatically processed. Right click on this database, choose ‘Process’:
(2) In the opening ‘Process database’ form, click the ‘Script Action ......