Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sqlserver ÊÓͼ

/*drop table scourse
drop table course
drop table student
drop table major*/
create database db
use db
--רҵ±í
create table major
(spno char(5) not null primary key,
 spname varchar(20) not null,
 pno char(2) )
--ѧÉú±í
create table student
(sno char(7) not null primary key,
 sname varchar(20) not null,
 ssex char(2) not null,
 sage smalldatetime ,
 spno char(5) not null foreign key references major(spno),
 classid char(5),
 Inyear char(4) not null )
--¿Î³Ì±í
create table course
(cno char(10) not null primary key,
cname varchar(20) not null,
credit smallint ,
tno char(3))
--Ñ¡¿Î±í
create table scourse
(sno char(7) not null foreign key references student(sno),
 cno char(10) not null foreign key references course(cno),
 Gmark numeric(4,1),
primary key(sno,cno))
/*£¨1£©½¨Á¢00312רҵѡÐÞÁË001ºÅ¿Î³ÌµÄѧÉúÊÓͼStu_01312_1£»
£¨2£©½¨Á¢00312רҵѡÐÞÁË1ºÅ¿Î³Ì²¢Çҳɼ¨²»¼°¸ñµÄѧÉúÊÓͼStu_00312_2£»
£¨3£©½¨Á¢ÊÓͼStu_year£¬ÓÉѧÉúѧºÅ¡¢ÐÕÃû¡¢ÄêÁä×é³É£»
£¨4£©Í¨¹ýÊÓͼ²éѯ20ËêÒÔÉϵÄѧÉúÐÕÃû£»
£¨5£©Í¨¹ýÊÓͼ²éѯ00312רҵѡÐÞÁË1ºÅ¿Î³Ì²¢Çҳɼ¨²»¼°¸ñµÄѧÉúµÄѧºÅ¡¢ÐÕÃû¡¢ÄêÁä¡£*/
//µÚÒ»Ìâ
 drop view Stu_01312_1
 go
  create view Stu_01312_1 as select * from student where spno='00312' and sno in (select sno from scourse where cno='1')
 go
  select * from Stu_01312_1
//µÚ¶þÌâ
drop view Stu_00312_2
  go
  create view   Stu_00312_2 as select * from student where spno='00312'  and sno in(select sno from scourse where cno='1' and Gmark < 60)
 go
select * from Stu_00312_2
//µÚÈýÌâ
 drop view Stu_00312_3
go
create view Stu_00312_3 as select sno,sname,sage from student
go
//µÚËÄÌâ
select sname from Stu_00312_3 where sage >20
//µÚÎåÌâ
select sno,sname,sage from Stu_00312_2


Ïà¹ØÎĵµ£º

ͨÓõÄSqlServer²Ù¿ØÀà

 using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;


public class CommandInfo
{
public string CommandText;
public SqlPa ......

JDBCÁ¬½ÓSQLServer³öÏÖµÄÒì³£

 ¿Î³ÌÉè¼ÆµÄµÚÒ»²½£º
 Óû§µÇ½ģ¿é:¾ÍÕâ¸öСģ¿é°ÑÎÒÕûËÀÁË£¬³öÏÖµÄÎÊÌâÒ»¸ö½Ó×ÅÒ»¸ö£¬×îÖ÷ÒªµÄ¾ÍÊÇÊý¾Ý¿âÁ¬½Ó.
 
 question1.
 java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
 Òì³£Ô­Òò£ºÃ»Óе¼Èëµ¼Çý¶¯°üsqljdbc.jar.
 question2.
  ......

sqlserver ´æ´¢¹ý³ÌÀý×Ó

 Ê²Ã´ÊÇ´æ´¢¹ý³ÌÄØ£¿
¡¡¡¡¶¨Ò壺
¡¡¡¡½«³£ÓõĻòºÜ¸´ÔӵŤ×÷£¬Ô¤ÏÈÓÃSQLÓï¾äдºÃ²¢ÓÃÒ»¸öÖ¸¶¨µÄÃû³Æ´æ´¢ÆðÀ´, ÄÇôÒÔºóÒª½ÐÊý¾Ý¿âÌṩÓëÒѶ¨ÒåºÃµÄ´æ´¢¹ý³ÌµÄ¹¦ÄÜÏàͬµÄ·þÎñʱ,Ö»Ðèµ÷ÓÃexecute,¼´¿É×Ô¶¯Íê³ÉÃüÁî¡£
¡¡¡¡½²µ½ÕâÀï,¿ÉÄÜÓÐÈËÒªÎÊ£ºÕâô˵´æ´¢¹ý³Ì¾ÍÊÇÒ»¶ÑSQLÓï¾ä¶øÒѰ¡£¿
¡¡¡¡Microsoft¹«Ë¾ÎªÊ²Ã´»¹ ......

SQLServer Óαê¼ò½éÓëʹÓÃ˵Ã÷

 Óα꣨Cursor£©ÊÇ´¦ÀíÊý¾ÝµÄÒ»ÖÖ·½·¨£¬ÎªÁ˲鿴»òÕß´¦Àí½á¹û¼¯ÖеÄÊý¾Ý£¬ÓαêÌṩÁËÔÚ½á¹û¼¯ÖÐÒ»´ÎÒÔÐлòÕß¶àÐÐǰ½ø»òÏòºóä¯ÀÀÊý¾ÝµÄÄÜÁ¦¡£ÎÒÃÇ¿ÉÒÔ°ÑÓα굱×÷Ò»¸öÖ¸Õ룬Ëü¿ÉÒÔÖ¸¶¨½á¹ûÖеÄÈκÎλÖã¬È»ºóÔÊÐíÓû§¶ÔÖ¸¶¨Î»ÖõÄÊý¾Ý½øÐд¦Àí¡£
      1.ÓαêµÄ×é³É
    ......

̸JDBC SQLSERVER"Error establishing socket"

 
jdbcÅäÖÃÓï¾äΪ: jdbc:microsoft:sqlserver://server_name:1433
ÈçÔËÐгÌÐòʱ³öÏÖ "Error establishing socket" ´íÎó,ÔòÓ¦½øÐÐÈçϵ÷ÊÔ:
1 ¼ì²éSQL SERVER ÊÇ·ñÔÊÐíÔ¶³Ì·ÃÎÊ.¾ßÌå²½Öè:
1)´ò¿ª"ÆóÒµ¹ÜÀíÆ÷",´ò¿ª¿ØÖÆÌ¨¸ùĿ¼>SQL Server ×é>Êý¾Ý¿â
2)ÔÚÏàÓ¦"Êý¾Ý¿â"Éϵ¥»÷ÓÒ¼ü,Ñ¡Ôñ"ÊôÐÔ"
3)Ñ¡Ôñ"Á¬½Ó"Ñ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ