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

sql server ¸ü¸Ä±íµÄËùÊôÓû§µÄÁ½¸ö·½·¨

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)
DECLARE @OwnerName as NVARCHAR(128)
DECLARE curObject CURSOR FOR
select 'Name' = name,
'Owner' = user_name(uid)
from sysobjects
where user_name(uid)=@OldOwner
order by name
OPEN curObject
FETCH NEXT from curObject INTO @Name, @Owner
WHILE(@@FETCH_STATUS=0)
BEGIN
if @Owner=@OldOwner
begin
set @OwnerName = @OldOwner + '.' + rtrim(@Name)
exec sp_changeobjectowner @OwnerName, @NewOwner
end
-- select @name,@NewOwner,@OldOwner
FETCH NEXT from curObject INTO @Name, @Owner
END
close curObject
deallocate curObject


Ïà¹ØÎĵµ£º

¶¨ÆÚɾ³ý±¸·ÝµÄSQLÊý¾Ý¿âµÄ½Å±¾

  ±ÈÈçij¸öÊý¾Ý¿â϶ÔSQL SERVERµÄÊý¾Ý¿â½øÐÐÁËÿÌìµÄ±¸·Ý£¬ÏÖÔÚÒª±£Áô7ÌìÒÔÄڵģ¬ÆäËûµÄɾ³ýµô£¬ÓÃASP¿ÉÒÔʵÏÖÁË£¬µ«ÒªÓõ½filesystemobject£¬²»´óˬ
    Ê×ÏÈдһ¸öjsÎļþclearDatabaseBackup£¬ÄÚÈÝÈçÏÂ
function deleteBackupFile(beforedays) {
    var fso = new ActiveXObject ......

ÀûÓÃtypeperf¹¤¾ßÊÕ¼¯SQL ServerÐÔÄÜÊý¾Ý

Ò»£®ÀûÓÃTypePerf.exeÃüÁîÐй¤¾ß°ÑWindows²Ù×÷ϵͳµÄÐÔÄܼÆÊýÆ÷Êý¾Ý¼Ç¼µ½Êý¾Ý¿âÖÐ
 
¿ÉÒÔÔÚ×÷ÒµÖн¨Á¢ÒÔϽű¾
1.ÆôÓÃxp_cmdshell
--ĬÈÏÇé¿öÏÂ,sql server2005°²×°Íêºó,xp_cmdshellÊǽûÓõÄ(¿ÉÄÜÊÇ°²È«¿¼ÂÇ),Èç¹ûҪʹÓÃËü,¿É°´ÒÔϲ½Öè
 
-- ÔÊÐíÅäÖø߼¶Ñ¡Ïî
EXEC sp_configure 'show advanced options ......

SQL Server´´½¨ÊÓͼ

2009-10-08 16:05
ʲôÊÇÊÓͼ
     ´ó¼Ò¶¼ÖªµÀ£¬ÎÒÃǹú¼ÒÏÖÔÚ“ÉñÆß”ÉÏÌìÁË¡£´ÓÃÀ¹úµÄÔÂÇòµÇÔ¿ªÊ¼£¬ÈËÀàÉÏÌì²»ÔÙÊÇÉñ»°¡£Ìý˵£¬ÔÚÃÀ¹ú£¬ÄãÖ»Òª³ö¼¸Ê®ÍòÃÀÔª£¬Äú¾Í¿ÉÒÔÉÏÒ»´ÎÔÂÇò½øÐÐÌ«¿ÕÂÃÐУ¬ËùÒÔ£¬ÎÒÃÇÏàÐÅ£ºÔÚ²»¾ÃµÄ½«À´£¬ÉÏÌìÂÃÐн«×ß½øÎÒÃÇ°ÙÐÕµÄÉú»î£¬ÄÇÊÇÒ»¼þ¶àôÐÂÏÊÉñÆæµÄÊÂÇé° ......

OracleÖÐSQLÓï¾ä½âÎöµÄ²½Öè

ÎÒÃǶ¼ÖªµÀÔÚOracleÖÐÿÌõSQLÓï¾äÔÚÖ´ÐÐ֮ǰ¶¼ÐèÒª¾­¹ý½âÎö£¬ÕâÀïÃæÓÖ·ÖΪÈí½âÎöºÍÓ²½âÎö¡£ÄÇôÕâÁ½ÖÖ½âÎöÓкβ»Í¬Ö®´¦ÄØ£¿ËüÃÇÓÖ·Ö±ðÊÇÈçºÎ½øÐнâÎöÄØ£¿OracleÄÚ²¿½âÎöµÄ²½ÖèÓÖÊÇÈçºÎ½øÐеÄÄØ£¿ÏÂÃæÎÒÃǾÍÕâЩ»°Ìâ½øÐй²Í¬Ì½ÌÖ¡£ ÔÚOracleÖдæÔÚÁ½ÖÖÀàÐ͵ÄSQLÓï¾ä£¬Ò»ÀàΪDDLÓï¾ä£¬ËûÃÇÊÇ´ÓÀ´²»»á¹²ÏíʹÓõģ¬Ò²¾ÍÊÇÿ´ÎÖ´ ......

SQLÊý¾Ý¿âÁ¬½ÓÓï¾ä

Ò»°ãµÄÔ¶³Ì·ÃÎʵÄд³ÉÕâÑù£º
Data Source=IP;Initial Catalog=Êý¾Ý¿âÃû;UserID=Óû§Ãû;Password=ÃÜÂë
±¾µØ·ÃÎʵÄд³ÉÕâÑù£º
Data Source=(local);Initial Catalog=Êý¾Ý¿âÃû;UserID=Óû§Ãû;Password=ÃÜÂë
Èç¹ûÊDZ¾µØµÄ£¬Í¨¹ýwindows×é¼þÑéÖ¤µÄ£¨Ò²¾ÍÊÇûÓÐÓû§Ãû£¬ÃÜÂëµÄ£©Ð´³ÉÕâÑù£º
Data Source=(local);Initial Cata ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ