¸öÈË×ܽáµÄ¼¸Ìõ±È½ÏÓÐÒâ˼µÄsqlÓï¾ä
--------------------------------------------------------------------
-- ×÷ÕߣºÕÅ°®¹ú
-- ÈÕÆÚ£º2010-01-23 15:00:17
-- ÃèÊö: һЩ±È½ÏÓÐÒâ˼µÄSQLÓï¾ä
-- Version:
-- Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
-- Feb 9 2007 22:47:07
-- Copyright (c) 1988-2005 Microsoft Corporation
-- Express Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
--------------------------------------------------------------------
--Ê×ÏÈ´´½¨Ò»¸ö²âÊÔÓõıí
--Ò»ÏÂÓï¾äÖÐÓõ½µÄ±ítb¾ùÖ¸Õâ¸ö²âÊÔ±í
--1¡¢Äã²ÂÏÂÃæÕâÌõÓï¾äÄܵõ½Ê²Ã´½á¹û£¬Õâ¸öºÜ³£ÓÃ
if object_id('tb') is not null
drop table tb
go select getdate()
create table tb(id int identity ,name varchar(10))
insert into tb select 'ÕÅÈý'
union all select 'ÀîËÄ'
union all select 'ÍõÎå'
union all select 'ÕÔÁù'
go
select * into ta from tb where 1<>1
--2¡¢ÏÂÃæÕâÌõÓï¾ä»á±¨´íÂð£¿ÎªÊ²Ã´£¬ÔõôÐ޸IJÅÄÜÈÃËüÊä³ö “ÕýÈ·” ÕâÁ½¸ö×Ö
select case when 1>1 then 1
when 1=1 then 'ÕýÈ·'
when 1<1 then 2
end
--3¡¢ Ôõô²ÅÄÜ×öµ½ÏÂÃæµÄÈýÌõͬʱִÐеõ½µÄ½á¹ûÊÇÃüÁîÒѳɹ¦Íê³É¡£
--¶ø²»ÊÇselect¸½½üÓÐÓï·¨´íÎó
select
select 1
select
--4¡¢ ˼¿¼Ò»ÏÂÕâ¸öÎÊÌâ
--ÔÚmasterÖн¨¸ö±í£¬ÔÚÆäËü¿âÀï·ÃÎÊ(ͬһ·þÎñÆ÷)£¬²»ÔÊÐíʹÓÃÏÞ¶¨Ãû£¬ÈçºÎ²ÅÄÜÖ±½Ó·ÃÎÊ´Ë±í£¿
--5¡¢ datalength() ·µ»ØÓÃÓÚ±íʾÈκαí´ïʽµÄ×Ö½ÚÊý¡£
-- Äã²ÂÏÂÃæµÄ½á¹û»áÊÇʲô?Ϊʲô
select datalength('1'),datalength(1),datalength(getdate()),datalength('2010-01-23 13:01:37.280')
--6¡¢Äã¿ÉÒÔÊÔÊÔÏÂÃæµÄÈý¸öÓï¾ä£¬ÎªÊ²Ã´µÚÒ»¸ö»áÓÐÓï·¨´íÎ󣬶øµÚ¶þ¸ö½á¹ûÊÇÕýÈ·µÄ
--¢ñ£º
select * from tb ord
Ïà¹ØÎĵµ£º
sql server ¸ü¸Ä±íµÄËùÊôÓû§µÄÁ½¸ö·½·¨
--¸ü¸Äij¸ö±í
exec sp_changeobjectowner 'tablename','dbo'
--´æ´¢¸ü¸ÄÈ«²¿±í
CREATE PROCEDURE dbo.User_ChangeObjectOwnerBatch
@OldOwner as NVARCHAR(128),
@NewOwner as NVARCHAR(128)
AS
DECLARE @Name as NVARCHAR(128)
DECLARE @Owner as NVARCHAR(128)
D ......
---1¡¢Ìí¼ÓÊý¾ÝÎļþ
use master
go
--Fam200901
alter database RedfDB
add filegroup FGAM200901
go
alter database RedfDB
add file(name='FGAM200901',filename='D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Fam200901.mdf',
size=20,maxsize=40,filegrowth=10% ......
Oracle µÄSQL*LOADER¿ÉÒÔ½«ÍⲿÊý¾Ý¼ÓÔص½Êý¾Ý¿â±íÖС£ÏÂÃæÊÇSQL*LOADERµÄ»ù±¾Ìص㣺
1£©ÄÜ×°È벻ͬÊý¾ÝÀàÐÍÎļþ¼°¶à¸öÊý¾ÝÎļþµÄÊý¾Ý
2£©¿É×°Èë¹Ì¶¨¸ñʽ£¬×ÔÓɶ¨½çÒÔ¼°¿É¶È³¤¸ñʽµÄÊý¾Ý
3£©¿ÉÒÔ×°Èë¶þ½øÖÆ£¬Ñ¹ËõÊ®½øÖÆÊý¾Ý
4£©Ò»´Î¿É¶Ô¶à¸ö±í×°ÈëÊý¾Ý
5£©Á¬½Ó¶à¸öÎïÀí¼Ç¼װµ½Ò»¸ö¼Ç¼ÖÐ
6£©¶ÔÒ»µ¥¼Ç¼·Ö½âÔÙ×°Èëµ½± ......
µÚÒ»²¿·Ö:SQL serverÓëACCESSÊý¾Ý¿âµÄ½»»»
Èí¼þ¿ª·¢Íø
1. ÔÚSQL SERVERÀï²éѯaccessÊý¾Ý: Èí¼þ¿ª·¢Íø
SELECT * from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="c:\DB.mdb";User ID=Admin;Password=')...±íÃû
--------------------------------------------------------------------------
2. ½«ac ......