DECLARE DBNameCursor CURSOR
FOR
SELECT Name
FROM sys.databases
WHERE Name NOT IN ( 'master', 'model', 'msdb', 'tempdb',
'distribution' )
ORDER BY Name;
DECLARE @DBName NVARCHAR(128)
FETCH NEXT FROM DBNameCursor INTO @DBName
WHILE @@fetch_status = 0
BEGIN
!!!!!! SELECT *, DB_NAME(@DBName ) as [DBase] FROM _YearOffset !!!!!!! , как мне извлечь значение Курсора в этот момент??? Пробую по разному, КУРСОР НЕ ОТКРЫТ.
FETCH NEXT FROM DBNameCursor INTO @DBName
END
CLOSE DBNameCursor
DEALLOCATE DBNameCursor
DECLARE @name VARCHAR(50)
DECLARE @recovery_model_desc VARCHAR (500)
DECLARE db_cursor CURSOR FOR
SELECT name,recovery_model_desc AS Recovery_model
FROM sys.databases
WHERE name NOT IN ('model','master','tempdb','msdb')
ORDER BY recovery_model_desc, name
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name, @recovery_model_desc
WHILE @@FETCH_STATUS = 0
BEGIN
BEGIN
SELECT ???? from ????????
END
FETCH NEXT FROM db_cursor INTO @name, @recovery_model_desc
END
CLOSE db_cursor
DEALLOCATE db_cursor
Контроллер подстава конечно)