標籤:--第一題 查詢Student表中的所有記錄的Sname、Ssex和Class列。select Sname,Ssex,Class from student--第二題 查詢教師所有的單位即不重複的Depart列。select distinct Depart from Teacher--第三題 查詢Student表的所有記錄。select * from student--第四題 查詢Score表中成績在60到80之間的所有記錄。select * from Score where
標籤:問題 問題1 標題: Microsoft SQL Server 2008 R2 安裝程式 ------------------------------ 出現以下錯誤: Could not open key: UNKNOWN\Components\7ABFE44842C12B390AF18C3B9B1A1EE8\000021599B0090400100000000F01FEC. Verify that you have sufficient
標籤:無法刪除資料庫 "#Test",因為該資料庫當前正在使用--查詢分析器中執行下面的語句就行了. use master go declare @dbname sysname set @dbname=‘DB1‘ --這個是要刪除的資料庫庫名 declare @s nvarchar(1000) declare tb cursor local for select s=‘kill ‘+cast(spid as varchar)&
標籤:?1,查看資料庫的版本select @@version2,查看資料庫所在機器作業系統參數exec master..xp_msver查看資料庫啟動的參數sp_configure查看資料庫啟動時間select convert(varchar(30),login_time,120) from master..sysprocesses where spid=1查看所有資料庫名稱及大小sp_helpdb查看所有資料庫使用者登入資訊sp_helplogins3,.查看某資料庫下某個資料對象的大小sp_
標籤:SQLSERVER:通過sys.tables實現批量刪表,或者復原表 1 begin try 2 drop table #temp10 3 end try 4 begin catch 5 end catch 6 7 select ‘drop/*truncate*/ table tuning.‘+name as droptable,ROW_NUMBER() over(order by name) as rownumber 8 into #temp10 9 from
標籤:預設情況下登入使用者除了看到自己擁有系統管理權限的資料庫外。還可以看到其他資料庫,在點擊開啟時會提示沒有許可權。如下設定可使該使用者只能看到自己擁有系統管理權限的資料庫,而看不到其他沒有許可權的資料庫。(1)取消預設可查看任何資料庫DENY VIEW any DATABASE TO PUBLIC; -- 沒有進行使用權限設定,所有預設的登入使用者不能查看任何資料庫(2)賦予自己擁有系統管理權限的資料庫的查看許可權ALTER AUTHORIZATION ON DATABASE::