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

sqlserver »ù´¡ÖªÊ¶´óÕûÀí

SQL-Structured Query Language
--(¿ªÆôSQL·þÎñ£ºnet start mssqlserver)
--(ÔÚÃüÁîÐÐÖÐÊäÈë'sqlwb'ÃüÁî¿É´ò¿ªSQL¹ÜÀíÆ÷ )
--(Èç¹ûÒªÖ´ÐжàÌõÃüÁîÖеÄÒ»Ìõ,Êó±êÑ¡¶¨ºóÔÙ°´F5Ö´ÐÐ)
create database sales                           --´´½¨Ò»¸öÃûΪsalesµÄÊý¾Ý¿â
on
(
name='sales_data',
filename='d:\sales_data.mdf',
size=10,
maxsize=50,
filegrowth=5
)
log on
(
name='sales_log',
filename='d:\sales_log.ldf',
size=10,
maxsize=50,
filegrowth=5
)
drop database sales                             --ɾ³ýËù´´½¨µÄÊý¾Ý¿â
sp_helpdb sales                                 --²é¿´Êý¾Ý¿âµÄÏà¹ØÐÅÏ¢
sp_helpfile                                     --²é¿´µ±Ç°Êý¾Ý¿âÊý¾ÝÎļþÓëÈÕÖ¾ÎļþµÄÏà¹ØÐÅÏ¢
sp_detach_db sales                              --×ªÒÆÊý¾Ý¿âʱ·ÖÀëÊý¾Ý¿â
sp_attach_db sales,@filename1='Êý¾ÝÎļþ·¾¶Ãû'  --ÕûºÏ·ÖÀëµÄÊý¾Ý¿â                 
                  ,@filename2='ÈÕÖ¾Îļþ·¾¶Ãû'
--(ÈçºÎ¼õСÊý¾Ý¿âÈÕÖ¾ÎļþµÄ´óС:  a.·ÖÀëÊý¾Ý¿â b.×ªÒÆÈÕÖ¾Îļþ c .ÕûºÏÊý¾Ý¿âµ«²»Ö¸¶¨ÈÕÖ¾Îļþ)
--Êý¾Ý¿âµÄ±¸·Ý
sp_addumpdevice 'disk','mydisk','d:\sales.bak'  --Ìí¼ÓÉ豸¡


Ïà¹ØÎĵµ£º

SQLSERVER×ÔÔöÖ÷¼ü

SQLServer Öк¬×ÔÔöÖ÷¼üµÄ±í£¬Í¨³£²»ÄÜÖ±½ÓÖ¸¶¨IDÖµ²åÈ룬¿ÉÒÔ²ÉÓÃÒÔÏ·½·¨²åÈë¡£
1. SQLServer ×ÔÔöÖ÷¼ü´´½¨Óï·¨£º
identity(seed, increment)
ÆäÖÐ
seed Æðʼֵ
increment ÔöÁ¿
ʾÀý£º
create table student(
      id int identity(1,1),
      name varcha ......

SQLServerÊý¾Ý¼¯ºÏµÄ½»¡¢²¢¡¢²î¼¯ÔËËã

 SQLServer2005ͨ¹ýintersect,union,exceptºÍÈý¸ö¹Ø¼ü×Ö¶ÔÓ¦½»¡¢²¢¡¢²îÈýÖÖ¼¯ºÏÔËËã¡£
ËûÃǵĶÔÓ¦¹ØÏµ¿ÉÒԲο¼ÏÂÃæÍ¼Ê¾
       Ïà¹Ø²âÊÔʵÀýÈçÏ£º
use tempdb
go
if (object_id ('t1' ) is not null ) drop table t1
if (object_id ('t2' ) is not null ) drop table t2
go ......

SQLServerÖеÄÑ­»·Åú´¦Àí

  SQLServerÖеÄÑ­»·Åú´¦Àí
GOÃüÁîºóÃæ¼ÓÒ»¸ö³£Á¿¾Í¿ÉÒÔÁË
ÏÂÃæ·½·¨¿ÉÒÔÓÃÀ´¿ìËÙÉú³ÉÒ»ÅúÊý¾Ý
if (object_id ('t' ) is not null ) drop table t
go
create table t (id int identity (1 , 1 ), name varchar (40 ))
go
insert into t (name ) select newid ()
go 10
select * from t
/*
1 &nbs ......

SQLSERVER һЩ¾­µäÎÊÌâ×ܽá


SQLSERVER--һЩ¾­µäÎÊÌâ×ܽá
2007-04-01¡¡01:04:06
 
´óÖÐС
/**********************************/
--»ñµÃijһÌìËùÔÚÄêµÄµÚÒ»Ìì
declare @a datetime,@b datetime,@sum int,@num int,@res varchar(20)
select @a='1-6-1968'
select @b='2006-4-8'
select @sum=year(@a)
select @res=ltrim(cast(@sum as ......

Êý¾Ý½»»»Ñ§Ï°¶þ£ºasp.net C# ¶Ô sqlserver±íµÄ²Ù×÷

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ