System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().FullName.CodeBase)
compact framework does not support
AppDomain.CurrentDomain.BaseDirectory
System.Environment.CurrentDirectory
Application.StartupPath
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().FullName.CodeBase)
compact framework does not support
AppDomain.CurrentDomain.BaseDirectory
System.Environment.CurrentDirectory
Application.StartupPath
exec sp_grantdbaccess N'www1-w(username)', 'DBNAME'
GRANT EXECUTE ON objectname TO public
SELECT * FROM master.sys.database_permissions AS dp
JOIN sys.system_objects AS so
ON dp.major_id = so.object_id
WHERE dp.class = 1 AND so.parent_object_id = 0 ;
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
KILL [session_id]
SELECT @@SERVERNAME
Select * from sysservers where srvid = 0
Select Host_Name() as Computer_Name
EXEC xp_getNetName
SELECT CONVERT(sysname, SERVERPROPERTY(N'servername'))
DECLARE @temp as TABLE (
NAME VARCHAR(100) ,
ROWS INT,
RESERVED VARCHAR(100),
DATA VARCHAR(100),
INDEX_SIZE VARCHAR(100),
UNUSED VARCHAR(100))
INSERT INTO @temp EXEC sp_msforEachTable " exec sp_spaceused '?' "
SELECT * FROM @temp