Click here to Skip to main content
15,867,704 members
Home / Discussions / Database
   

Database

 
AnswerRe: Question On SQL Query Result Pin
Richard Deeming20-Jan-23 5:33
mveRichard Deeming20-Jan-23 5:33 
PraiseRe: Question On SQL Query Result Pin
crmfghtr20-Jan-23 5:41
crmfghtr20-Jan-23 5:41 
AnswerRe: Question On SQL Query Result Pin
Mycroft Holmes20-Jan-23 11:34
professionalMycroft Holmes20-Jan-23 11:34 
GeneralRe: Question On SQL Query Result Pin
crmfghtr20-Jan-23 12:41
crmfghtr20-Jan-23 12:41 
QuestionEF Core 6 Exclude Columns Pin
Kevin Marois19-Dec-22 8:47
professionalKevin Marois19-Dec-22 8:47 
AnswerRe: EF Core 6 Exclude Columns Pin
Dave Kreskowiak19-Dec-22 15:47
mveDave Kreskowiak19-Dec-22 15:47 
GeneralRe: EF Core 6 Exclude Columns Pin
Kevin Marois23-Dec-22 7:36
professionalKevin Marois23-Dec-22 7:36 
QuestionUsing SQL Native Backup URL, multiple databases to Azure Blob Storage Pin
Jaime Maccou9-Dec-22 1:00
Jaime Maccou9-Dec-22 1:00 
How to backup multiple database to Azure blob storage using native SQL Server Backup to URL option.

I have used the Ola Backup scripts with success but will like another option.

EXECUTE [dbo].[DatabaseBackup]
@Databases = 'USER_DATABASES',
@BackupType = 'FULL',
@Compress='Y',
@copyonly ='Y',
@Url='https://development.blob.core.windows.net/backups',
@BlockSize=65536,
@MaxTransferSize=4194304


--script to modify for multiple database
DECLARE @name VARCHAR(100) -- database name
Declare @url as Varchar(max) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup Wink | ;)
DECLARE @fileDate VARCHAR(20) -- used for file name

-- specify database backup directory e.g. 'https://development.blob.core.windows.net/backups'
SET @url = 'https://development.blob.core.windows.net/backups'
-- specify filename format
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) + '_' + REPLACE(CONVERT(VARCHAR(20),GETDATE(),108),':','')

DECLARE db_cursor CURSOR READ_ONLY FOR
SELECT name
FROM master.sys.databases
WHERE name NOT IN ('master','model','msdb') -- exclude these databases
AND state = 0 -- database is online
AND is_in_standby = 0 -- database is not read only for log shipping

OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name

WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO URL = @URL

FETCH NEXT FROM db_cursor INTO @name
END

CLOSE db_cursor
DEALLOCATE db_cursor

-- Any suggestions that does not include having to execute the backup command for each database will be helpful
AnswerRe: Using SQL Native Backup URL, multiple databases to Azure Blob Storage Pin
jschell12-Dec-22 10:33
jschell12-Dec-22 10:33 
QuestionEntity Framework Core 6 VARCHAR(MAX) Pin
Kevin Marois8-Dec-22 12:54
professionalKevin Marois8-Dec-22 12:54 
AnswerRe: Entity Framework Core 6 VARCHAR(MAX) Pin
Victor Nijegorodov8-Dec-22 18:24
Victor Nijegorodov8-Dec-22 18:24 
GeneralRe: Entity Framework Core 6 VARCHAR(MAX) Pin
Kevin Marois9-Dec-22 11:47
professionalKevin Marois9-Dec-22 11:47 
GeneralRe: Entity Framework Core 6 VARCHAR(MAX) Pin
jschell12-Dec-22 10:35
jschell12-Dec-22 10:35 
QuestionSOLVED - Pivot a result set Pin
Richard Andrew x6428-Nov-22 5:46
professionalRichard Andrew x6428-Nov-22 5:46 
AnswerRe: SOLVED - Pivot a result set Pin
Richard Deeming28-Nov-22 21:24
mveRichard Deeming28-Nov-22 21:24 
QuestionTSQL - JOIN cancels out my date filter Pin
jkirkerx27-Nov-22 13:53
professionaljkirkerx27-Nov-22 13:53 
AnswerRe: TSQL - JOIN cancels out my date filter Pin
Graham Breach27-Nov-22 21:38
Graham Breach27-Nov-22 21:38 
GeneralRe: TSQL - JOIN cancels out my date filter Pin
jkirkerx28-Nov-22 6:32
professionaljkirkerx28-Nov-22 6:32 
GeneralRe: TSQL - JOIN cancels out my date filter Pin
jschell28-Nov-22 10:44
jschell28-Nov-22 10:44 
QuestionTSQL - Create a JOIN, knowing that it may not exist, but show the initial records at least instead of nothing [bad idea] - abandoned it Pin
jkirkerx21-Nov-22 9:15
professionaljkirkerx21-Nov-22 9:15 
AnswerMaybe this is a bad idea, so I abandoned it. Did a work around instead. Pin
jkirkerx21-Nov-22 9:35
professionaljkirkerx21-Nov-22 9:35 
AnswerRe: TSQL - Create a JOIN, knowing that it may not exist, but show the initial records at least instead of nothing [bad idea] - abandoned it Pin
Graham Breach21-Nov-22 10:29
Graham Breach21-Nov-22 10:29 
GeneralRe: TSQL - Create a JOIN, knowing that it may not exist, but show the initial records at least instead of nothing [solved] - May run with this Pin
jkirkerx21-Nov-22 11:04
professionaljkirkerx21-Nov-22 11:04 
AnswerRe: TSQL - Create a JOIN, knowing that it may not exist, but show the initial records at least instead of nothing [bad idea] - abandoned it Pin
Richard Deeming21-Nov-22 22:02
mveRichard Deeming21-Nov-22 22:02 
GeneralRe: TSQL - Create a JOIN, knowing that it may not exist, but show the initial records at least instead of nothing [bad idea] - abandoned it Pin
jkirkerx22-Nov-22 6:58
professionaljkirkerx22-Nov-22 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.