MS SqlserverÊÓͼÇÉÓÃ
1¡¢´´½¨Êý¾Ý¿âtestdb
2¡¢´´½¨±ítest
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[test](
[id] [nchar](10) COLLATE Chinese_PRC_CI_AS NULL,
[name] [nchar](10) COLLATE Chinese_PRC_CI_AS NULL,
[sex] [bit] NULL
) ON [PRIMARY]
3¡¢´´½¨Êý¾Ý¿âdb
4¡¢´´½¨ÊÓͼ
¡¡¡¡create view view_1
as
SELECT id, name, sex
from testdb.dbo.test
5¡¢select * from view_1
insert into view_1(id,name,sex)¡¡values('6','6','True')
update view_1¡¡set sex='false' where id=6
delete view_1 where id='6'
ͨ¹ýÒÔÉÏʵÑé¿ÉÒÔÖ¤Ã÷£¬ÊÓͼ¿ÉÒÔµ±×ö±íÀ´Ê¹Ó㬴Ӷø¿ÉÒÔʵÏÖ´ÓÒ»Êý¾Ý¿âÓ³Éäµ½ÁíÒ»Êý¾Ý¿â£¬
Ïà¹ØÎĵµ£º
CREATE function fGetPy(@str varchar(500)='')
returns varchar(500)
as
begin
declare @strlen int,@return varchar(500),@ii int
declare @c nchar(1),@chn nchar(1)
select @strlen=len(@str),@retur ......
´¥·¢Æ÷µÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)
´´½¨ DML »ò DDL ´¥·¢Æ÷¡£´¥·¢Æ÷ÊÇÊý¾Ý¿â·þÎñÆ÷Öз¢Éúʼþʱ×Ô¶¯Ö´ÐеÄÌØÖÖ´æ´¢¹ý³Ì¡£Èç¹ûÓû§ÒªÍ¨¹ýÊý¾Ý²Ù×÷ÓïÑÔ (DML) ʼþ±à¼Êý¾Ý£¬ÔòÖ´ÐÐ DML ´¥·¢Æ÷¡£DML ʼþÊÇÕë¶Ô±í»òÊÓͼµÄ INSERT¡¢UPDATE »ò DELETE Óï¾ä¡£DDL ´¥·¢Æ÷ÓÃÓÚÏìÓ¦¸÷ÖÖÊý¾Ý¶¨ÒåÓïÑÔ (DDL) ʼþ¡£ÕâЩÖ÷ÒªÊÇ CRE ......
Ë÷ÒýµÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)
Ϊָ¶¨±í»òÊÓͼ´´½¨¹ØϵË÷Òý£¬»òΪָ¶¨±í´´½¨ XML Ë÷Òý¡£¿ÉÔÚÏò±íÖÐÌîÈëÊý¾ÝÇ°´´½¨Ë÷Òý¡£¿Éͨ¹ýÖ¸¶¨ÏÞ¶¨µÄÊý¾Ý¿âÃû³Æ£¬ÎªÁíÒ»¸öÊý¾Ý¿âÖеıí»òÊÓͼ´´½¨Ë÷Òý¡£
Transact-SQL Óï·¨Ô¼¶¨
Óï·¨
Create Relational Index CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] IN ......
´æ´¢¹ý³ÌµÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)
´´½¨´æ´¢¹ý³Ì¡£´æ´¢¹ý³ÌÊÇÒѱ£´æµÄ Transact-SQL Óï¾ä¼¯ºÏ£¬»ò¶Ô Microsoft .NET Framework ¹«¹²ÓïÑÔÔËÐÐʱ (CLR) ·½·¨µÄÒýÓ㬿ɽÓÊÕ²¢·µ»ØÓû§ÌṩµÄ²ÎÊý¡£¿ÉÒÔ´´½¨¹ý³Ì¹©ÓÀ¾ÃʹÓ㬻òÔÚÒ»¸ö»á»°£¨¾Ö²¿ÁÙʱ¹ý³Ì£©ÖÐÁÙʱʹÓ㬻òÔÚËùÓлỰ£¨È«¾ÖÁÙʱ¹ý³Ì£©ÖÐÁÙʱʹÓá£
Æô¶¯ SQL ......
´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì£¬ÀàËÆÓÚÆäËü±à³ÌÓïÑÔÖеÄʼþº¯Êý£¬SQL Server? ÔÊÐíΪ INSERT¡¢UPDATE¡¢DELETE ´´½¨´¥·¢Æ÷£¬µ±ÔÚ±í£¨ÊÓͼ£©ÖвåÈë¡¢¸üС¢É¾³ý¼Ç¼ʱ£¬´¥·¢Ò»¸ö»òһϵÁÐ T-SQL Óï¾ä¡£
±¾×¨ÌâµÄÄ¿µÄ²¢·ÇÊÇÏòÄúÏ꾡µØ½éÉÜ´¥·¢Æ÷£¬¶øÊÇϵͳµØÏòÄú½éÉÜ´¥·¢Æ÷µÄ³£ÓÃ֪ʶÓëÏà¹ØÓ¦Ó㬲¢ÓëÄúÒ ......