Friday, March 23, 2012
How can I back up to a device with out over writing the last backu
database's to a device,,which works fine but it over writes the files in the
directory. The code i am using is
BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , N
AME =
N'my backup', NOSKIP , STATS = 10, NOFORMAT
Can anyone please help me with this, I tried using a mapped drive but that
does not work. Is there any way I can use a maint plan to back up to a devic
e
and not over write the last back up file? in the use this directory can I us
e
the unc?It WILL overwrite the old since you give same name to the backup file. You
must figure out another way to work for you. My backup will write to a
folder depend on what day of the week. So I always have a 7 days of backup.
hth,
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:254A39AA-C621-43B9-A12B-78AFCBF23F8F@.microsoft.com...
>I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in
> the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD ,
NAME =
> N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a
> device
> and not over write the last back up file? in the use this directory can I
> use
> the unc?
>|||The answer to my question is yes you can use the unc path in the use this
dircetory. but I still don't know about the device over write problem.
"DAVID S" wrote:
> I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in t
he
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD ,
NAME =
> N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but tha
t
> does not work. Is there any way I can use a maint plan to back up to a dev
ice
> and not over write the last back up file? in the use this directory can I
use
> the unc?
>|||NOINIT means append and INIT means overwrite. Your statement posted will app
end.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:254A39AA-C621-43B9-A12B-78AFCBF23F8F@.microsoft.com...
>I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in t
he
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD ,
NAME =
> N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a dev
ice
> and not over write the last back up file? in the use this directory can I
use
> the unc?
>
How can I back up to a device with out over writing the last backu
database's to a device,,which works fine but it over writes the files in the
directory. The code i am using is
BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME =
N'my backup', NOSKIP , STATS = 10, NOFORMAT
Can anyone please help me with this, I tried using a mapped drive but that
does not work. Is there any way I can use a maint plan to back up to a device
and not over write the last back up file? in the use this directory can I use
the unc?
It WILL overwrite the old since you give same name to the backup file. You
must figure out another way to work for you. My backup will write to a
folder depend on what day of the week. So I always have a 7 days of backup.
hth,
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:254A39AA-C621-43B9-A12B-78AFCBF23F8F@.microsoft.com...
>I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in
> the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME =
> N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a
> device
> and not over write the last back up file? in the use this directory can I
> use
> the unc?
>
|||The answer to my question is yes you can use the unc path in the use this
dircetory. but I still don't know about the device over write problem.
"DAVID S" wrote:
> I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME =
> N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a device
> and not over write the last back up file? in the use this directory can I use
> the unc?
>
|||NOINIT means append and INIT means overwrite. Your statement posted will append.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:254A39AA-C621-43B9-A12B-78AFCBF23F8F@.microsoft.com...
>I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME =
> N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a device
> and not over write the last back up file? in the use this directory can I use
> the unc?
>
How can I back up to a device with out over writing the last backu
database's to a device,,which works fine but it over writes the files in the
directory. The code i am using is
BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME = N'my backup', NOSKIP , STATS = 10, NOFORMAT
Can anyone please help me with this, I tried using a mapped drive but that
does not work. Is there any way I can use a maint plan to back up to a device
and not over write the last back up file? in the use this directory can I use
the unc?It WILL overwrite the old since you give same name to the backup file. You
must figure out another way to work for you. My backup will write to a
folder depend on what day of the week. So I always have a 7 days of backup.
hth,
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:254A39AA-C621-43B9-A12B-78AFCBF23F8F@.microsoft.com...
>I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in
> the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME => N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a
> device
> and not over write the last back up file? in the use this directory can I
> use
> the unc?
>|||The answer to my question is yes you can use the unc path in the use this
dircetory. but I still don't know about the device over write problem.
"DAVID S" wrote:
> I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME => N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a device
> and not over write the last back up file? in the use this directory can I use
> the unc?
>|||Have you thought of using RETAINDAYS parameter in your backup statement.
Check BOL...
Thanks
GYK
"DAVID S" wrote:
> The answer to my question is yes you can use the unc path in the use this
> dircetory. but I still don't know about the device over write problem.
> "DAVID S" wrote:
> > I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> > database's to a device,,which works fine but it over writes the files in the
> > directory. The code i am using is
> >
> > BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME => > N'my backup', NOSKIP , STATS = 10, NOFORMAT
> >
> > Can anyone please help me with this, I tried using a mapped drive but that
> > does not work. Is there any way I can use a maint plan to back up to a device
> > and not over write the last back up file? in the use this directory can I use
> > the unc?
> >
> >|||Yes and it did not work.. but thank you for responding
"GYK" wrote:
> Have you thought of using RETAINDAYS parameter in your backup statement.
> Check BOL...
> Thanks
> GYK
> "DAVID S" wrote:
> > The answer to my question is yes you can use the unc path in the use this
> > dircetory. but I still don't know about the device over write problem.
> >
> > "DAVID S" wrote:
> >
> > > I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> > > database's to a device,,which works fine but it over writes the files in the
> > > directory. The code i am using is
> > >
> > > BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME => > > N'my backup', NOSKIP , STATS = 10, NOFORMAT
> > >
> > > Can anyone please help me with this, I tried using a mapped drive but that
> > > does not work. Is there any way I can use a maint plan to back up to a device
> > > and not over write the last back up file? in the use this directory can I use
> > > the unc?
> > >
> > >|||Try removing the name = N'my backup'... leave it blank and try...
Thanks
GYK
"DAVID S" wrote:
> Yes and it did not work.. but thank you for responding
> "GYK" wrote:
> > Have you thought of using RETAINDAYS parameter in your backup statement.
> > Check BOL...
> >
> > Thanks
> > GYK
> >
> > "DAVID S" wrote:
> >
> > > The answer to my question is yes you can use the unc path in the use this
> > > dircetory. but I still don't know about the device over write problem.
> > >
> > > "DAVID S" wrote:
> > >
> > > > I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> > > > database's to a device,,which works fine but it over writes the files in the
> > > > directory. The code i am using is
> > > >
> > > > BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME => > > > N'my backup', NOSKIP , STATS = 10, NOFORMAT
> > > >
> > > > Can anyone please help me with this, I tried using a mapped drive but that
> > > > does not work. Is there any way I can use a maint plan to back up to a device
> > > > and not over write the last back up file? in the use this directory can I use
> > > > the unc?
> > > >
> > > >|||NOINIT means append and INIT means overwrite. Your statement posted will append.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DAVID S" <DAVIDS@.discussions.microsoft.com> wrote in message
news:254A39AA-C621-43B9-A12B-78AFCBF23F8F@.microsoft.com...
>I am using sql2000 sp3 on windows 2003 server. I am trying to back up my
> database's to a device,,which works fine but it over writes the files in the
> directory. The code i am using is
> BACKUP DATABASE [mydb] TO [mydbbackup] WITH NOINIT , NOUNLOAD , NAME => N'my backup', NOSKIP , STATS = 10, NOFORMAT
> Can anyone please help me with this, I tried using a mapped drive but that
> does not work. Is there any way I can use a maint plan to back up to a device
> and not over write the last back up file? in the use this directory can I use
> the unc?
>
Wednesday, March 7, 2012
How "WHERE" clause can be used in MDX query?
Hi,
I am writing MDX query to retrive a set of data based on selected range of date.
I have written a MDX query but it is not filtering .
My code:
SELECT NON EMPTY { [Measures].[Fact Table Count] } ON COLUMNS, NON EMPTY topcount({ ([Date Time1].[Date Time1].[Date Time1].ALLMEMBERS ) } ,1000)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Date Time1].[Date Time1].&[2006-01-25T05:53:07] : [Date Time1].[Date Time1].&[2006-02-25T15:53:56] ) ON COLUMNS FROM [Cube Analysis]) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
This code should display only data with selected range of date but it displaying all data.
Can any one give a solution to filter the data based on Date using WHERE clause.
Thank you.
The subcube filter looks fine. Can you repro this against the Adventure Works cube?|||
Try this
with member [Measures].[FILTERBYTIME] AS
SUM(
CROSSJOIN(
[Measures].[Fact Table Count],
[Date Time1].[Date Time1].&[2006-01-25T05:53:07] : [Date Time1].[Date Time1].&[2006-02-25T15:53:56]
)
)
SELECT
NON EMPTY { [Measures].[FILTERBYTIME] } ON COLUMNS,
NON EMPTY topcount(
{
([Date Time1].[Date Time1].[Date Time1].ALLMEMBERS )
} ,1000
)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Cube Analysis] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
or try this one.
SELECT
NON EMPTY
{ [Measures].[Fact Table Count] } ON COLUMNS,
NON EMPTY topcount(
{
([Date Time1].[Date Time1].[Date Time1].ALLMEMBERS )
} ,1000
)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Cube Analysis]
where
{
[Date Time1].[Date Time1].&[2006-01-25T05:53:07] : [Date Time1].[Date Time1].&[2006-02-25T15:53:56]
}
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
How "WHERE" clause can be used in MDX query?
Hi,
I am writing MDX query to retrive a set of data based on selected range of date.
I have written a MDX query but it is not filtering .
My code:
SELECT NON EMPTY { [Measures].[Fact Table Count] } ON COLUMNS, NON EMPTY topcount({ ([Date Time1].[Date Time1].[Date Time1].ALLMEMBERS ) } ,1000)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Date Time1].[Date Time1].&[2006-01-25T05:53:07] : [Date Time1].[Date Time1].&[2006-02-25T15:53:56] ) ON COLUMNS FROM [Cube Analysis]) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
This code should display only data with selected range of date but it displaying all data.
Can any one give a solution to filter the data based on Date using WHERE clause.
Thank you.
The subcube filter looks fine. Can you repro this against the Adventure Works cube?|||
Try this
with member [Measures].[FILTERBYTIME] AS
SUM(
CROSSJOIN(
[Measures].[Fact Table Count],
[Date Time1].[Date Time1].&[2006-01-25T05:53:07] : [Date Time1].[Date Time1].&[2006-02-25T15:53:56]
)
)
SELECT
NON EMPTY { [Measures].[FILTERBYTIME] } ON COLUMNS,
NON EMPTY topcount(
{
([Date Time1].[Date Time1].[Date Time1].ALLMEMBERS )
} ,1000
)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Cube Analysis] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
or try this one.
SELECT
NON EMPTY
{ [Measures].[Fact Table Count] } ON COLUMNS,
NON EMPTY topcount(
{
([Date Time1].[Date Time1].[Date Time1].ALLMEMBERS )
} ,1000
)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Cube Analysis]
where
{
[Date Time1].[Date Time1].&[2006-01-25T05:53:07] : [Date Time1].[Date Time1].&[2006-02-25T15:53:56]
}
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS