jump to navigation

ms sql server การ Backup database Schedule August 9, 2010

Posted by jbanju in Programming ASP.NET.
trackback

declare @CurDD varchar(15)
declare @Path nvarchar(200)
SELECT @CurDD = DATENAME(WEEKDAY, GETDATE())

if @CurDD is not null
begin
set @Path=’C:\DB_BACKUP\DB1_’ +  @CurDD

— Backup
BACKUP DATABASE DB1
TO DISK = @Path WITH NOFORMAT,NOINIT,
NAME = N’DB1_DB-Full Database Backup’,SKIP,NOREWIND,NOUNLOAD,
STATS = 10

end

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: