• T-SQL quries


    SELECT @@VERSION;

    SELECT SERVERPROPERTY('EngineEdition');

    1 = Personal or Desktop Engine
    2 = Standard
    3 = Enterprise
    4 = Express
    5 = SQL Database
    6 = SQL Data Warehouse
    8 = SQL Managed Instance

    SELECT * FROM sys.databases;
    SELECT * FROM sys.objects;

    SELECT * FROM sys.dm_os_schedulers where STATUS = 'VISIBLE ONLINE';

    SELECT * FROM sys.dm_process_memory

    Azure SQL:SELECT * FROM sys.dm_user_db_resource_governance;SELECT * FROM sys.dm_os_job_object

    SELECT * FROM sys.dm_exec_requests;

    CREATE LOGIN ApplicationUser WITH PASSWORD = 'YourStrongPassword1';

    -- Create a new SQL user from that login
    CREATE USER ApplicationUser FOR LOGIN ApplicationUser;

    -- Until you run the following two lines, ApplicationUser has no access to read or write data
    ALTER ROLE db_datareader ADD MEMBER ApplicationUser;
    ALTER ROLE db_datawriter ADD MEMBER ApplicationUser;
    ALTER TABLE Data.Membership ALTER COLUMN FirstName
    ADD MASKED WITH (FUNCTION = 'partial(1, "xxxxx", 1)')
    GRANT UNMASK TO DataOfficers;
    REVOKE UNMASK TO Bob;  
    EXECUTE AS USER = 'Bob';

     SELECT DATABASEPROPERTYEX(DB_NAME(), 'Updateability')

    SELECT client_net_address FROM sys.dm_exec_connections WHERE session_id=@@SPID;

    DBCC SHRINKDATABASE

    DBCC SHRINKFILE

     

  • 相关阅读:
    JavaScript数据结构——模仿ES6中定义的类似的Set类
    webpack简单的项目配置发生的错误
    三国
    把握中国经济的大局与动力
    人生道路
    C++
    https://计算机等级分类总结
    https://计算机四级
    https://计算机三级
    https://计算机二级
  • 原文地址:https://www.cnblogs.com/jade0702/p/15133857.html
Copyright © 2020-2023  润新知