může být provedena několika způsoby. Jedním z nich je.
sp_changedbowner 'pal'
sp_helpdb [database_name]
SELECT @@VERSION
SELECT * INTO [database1].dbo.[table1] FROM [database2].dbo.[table2]
select * from sysdatabases where upper(filename) like upper('%cast_cesty_databaze%')
SELECT name, collation_name,compatibility_level FROM sys.databases WHERE UPPER(name) LIKE UPPER('%PAL%');
SELECT DB_NAME(), t.name, c.name, c.collation_name, s.name
FROM sys.tables t
INNER JOIN sys.columns c ON c.object_id=t.object_id
INNER JOIN sys.types s ON s.user_type_id=c.user_type_id
WHERE c.collation_name not like '%CS_AS' AND c.collation_name is not NULL
ORDER BY t.name ASC, c.name ASC;
select * from sys.assembly_modules
SELECT *
FROM dbo.sysobjects
WHERE type IN ('P','X','PC')
ORDER BY name
SELECT
sysobjects.name AS trigger_name ,OBJECT_NAME(parent_obj) AS table_name ,s.name AS table_schema
,USER_NAME(sysobjects.uid) AS trigger_owner
,OBJECTPROPERTY( id, 'ExecIsUpdateTrigger') AS isupdate
,OBJECTPROPERTY( id, 'ExecIsDeleteTrigger') AS isdelete
,OBJECTPROPERTY( id, 'ExecIsInsertTrigger') AS isinsert
,OBJECTPROPERTY( id, 'ExecIsAfterTrigger') AS isafter
,OBJECTPROPERTY( id, 'ExecIsInsteadOfTrigger') AS isinsteadof
,OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') AS [disabled]
FROM sysobjects
INNER JOIN sysusers ON sysobjects.uid = sysusers.uid
INNER JOIN sys.tables t ON sysobjects.parent_obj = t.object_id
INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
WHERE sysobjects.type = 'TR'
SELECT DB_NAME(dbid) AS DBName,
COUNT(dbid) AS NumberOfConnections,
loginame
FROM sys.sysprocesses
GROUP BY dbid, loginame
ORDER BY DB_NAME(dbid)
pro MSSQL2012 a novější
USE [master];
DECLARE @kill varchar(8000) = '';
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';'
FROM sys.dm_exec_sessions
WHERE database_id = db_id('DB_PALSTAT_NAME')
EXEC(@kill);
pro 2000, 2005, 2008
USE master;
DECLARE @kill varchar(8000); SET @kill = '';
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), spid) + ';'
FROM master..sysprocesses
WHERE dbid = db_id('DB_PALSTAT_NAME')
EXEC(@kill);
© Copyright 1992 - 2024 PALSTAT s.r.o. |
PALSTAT s.r.o. Bucharova 230 543 02 Vrchlabí CZECH REPUBLIC |
tel.: +420 499 422 044 tel.: +420 499 692 016 www.palstat.cz |
» Hlavní strana » Školení » Reference » Novinky |
» Události » Partneři » Podpora » Kontakt |
» Produkty » Zákaznický portál » Vzdálená pomoc » Aktualizace |
» Obchodní podmínky » Fotogalerie » GDPR, zásady ochrany soukromí » Portal 2 |