Showing posts with label writing. Show all posts
Showing posts with label writing. Show all posts

Tuesday, March 27, 2012

Creating VirtualDeviceSet for Remote SQL Server 2005 failed.

Hi, all!

I am writing the VDI application to allow backup/restore MS SQL Server 2005. I would want to backup/restore remote servers as well as local. I have local instance of MS SQL 2005 and remote. Local instance has MSSQL2005_ZORG instance name, remote uses default (so it supposed to be MSSQLSERVER).

While connection to those server via SQL Server Management studio i see local server as "ZORG\MSSQL2005_ZORG" and remote as "VM2000SRVZ2".

When i try to create VIrtualDeviceSet via CreateEx i pass "MSSQL2005_ZORG" as lpInstanceName parameter and all works fine. But I could't create same device set for remote 'MSSQLSERVER' instance. I passed any combination for that, such as "VM2000SRVZ2\MSSQLSERVER", "MSSQLSERVER", "VM2000SRVZ2", "\\VM2000SRVZ2\MSSQLSERVER" and so on. No luck always get VD_E_INSTANCE_NAME (0x80770007).

Any idea?

--Thanks

Hi,
As per the Microsoft Virtual Backup specifications, VDI can be used only on local machines.You can download the specifications from

http://www.microsoft.com/downloads/details.aspx?familyid=416f8a51-65a3-4e8e-a4c8-adfe15e850fc&displaylang=en

If u have used VDI for some time, i need ur help.Relpy if you can

Creating VirtualDeviceSet for Remote SQL Server 2005 failed.

Hi, all!

I am writing the VDI application to allow backup/restore MS SQL Server 2005. I would want to backup/restore remote servers as well as local. I have local instance of MS SQL 2005 and remote. Local instance has MSSQL2005_ZORG instance name, remote uses default (so it supposed to be MSSQLSERVER).

While connection to those server via SQL Server Management studio i see local server as "ZORG\MSSQL2005_ZORG" and remote as "VM2000SRVZ2".

When i try to create VIrtualDeviceSet via CreateEx i pass "MSSQL2005_ZORG" as lpInstanceName parameter and all works fine. But I could't create same device set for remote 'MSSQLSERVER' instance. I passed any combination for that, such as "VM2000SRVZ2\MSSQLSERVER", "MSSQLSERVER", "VM2000SRVZ2", "\\VM2000SRVZ2\MSSQLSERVER" and so on. No luck always get VD_E_INSTANCE_NAME (0x80770007).

Any idea?

--Thanks

Hi,
As per the Microsoft Virtual Backup specifications, VDI can be used only on local machines.You can download the specifications from

http://www.microsoft.com/downloads/details.aspx?familyid=416f8a51-65a3-4e8e-a4c8-adfe15e850fc&displaylang=en

If u have used VDI for some time, i need ur help.Relpy if you can

Sunday, March 25, 2012

Creating User Defined Function for Rolling Calendar Year

Has anyone ever created a UDF for a rolling calendar year? I would like to
use that instead of writing this kind of stuff all the time:
if(datepart(month,@.CurrentDate) =12)
Begin
set @.PastDate = '1/1/'+convert(varchar, @.SelectedYear)
end
if(datepart(month,@.CurrentDate) !=12)
Begin
set @.PastDate = dateadd(month,1,@.PastDate)
End
set @.CurrentDate = dateadd(month,1,@.Currentdate)
if(datepart(day, @.CurrentDate) <= 30)
Begin
set @.CurrentDateStep = dateadd(day,1,@.CurrentDate)
if datepart(month,@.CurrentDateStep) = datepart(month,@.CurrentDate)
Begin
set @.currentDate = @.CurrentDateStep
end
if datepart(month, @.CurrentDate) = 3
Begin
set @.CurrentDate = dateadd(day,2,@.CurrentDate)
end
end
Thanks in advance for any assistance.
Thanks,
SPHow about a calendar table?
http://www.aspfaq.com/2519
"SP" <SP@.discussions.microsoft.com> wrote in message
news:8E1056B9-3011-4523-894A-1087FE936B1A@.microsoft.com...
> Has anyone ever created a UDF for a rolling calendar year? I would like to
> use that instead of writing this kind of stuff all the time:
> if(datepart(month,@.CurrentDate) =12)
> Begin
> set @.PastDate = '1/1/'+convert(varchar, @.SelectedYear)
> end
> if(datepart(month,@.CurrentDate) !=12)
> Begin
> set @.PastDate = dateadd(month,1,@.PastDate)
> End
> set @.CurrentDate = dateadd(month,1,@.Currentdate)
> if(datepart(day, @.CurrentDate) <= 30)
> Begin
> set @.CurrentDateStep = dateadd(day,1,@.CurrentDate)
> if datepart(month,@.CurrentDateStep) = datepart(month,@.CurrentDate)
> Begin
> set @.currentDate = @.CurrentDateStep
> end
> if datepart(month, @.CurrentDate) = 3
> Begin
> set @.CurrentDate = dateadd(day,2,@.CurrentDate)
> end
> end
> Thanks in advance for any assistance.
> Thanks,
> SP
>|||Hi,
Pardon me for my ignorance, can you please elucidate with an example what
you are trying to achieve?
--
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/|||Sure. Sorry for the sparse information.
At the company that I work for, they are always interested in a rolling
calendar year. When I write reports with Reporting Services, they may run
them for say 2006. The end date would always change depending on what month
the report is run. For example, if the report is run today, they would want
the results to show 6/1/2005 to 5/31/2006. If it gets run next month,
7/1/2005 to 6/30/2006, etc.
I always have to wrote some funky code to consider February, etc.
I just thought if someone had written a UDF, that might help. Or send me in
the right direction.
I hope this clarifies things a little and I will definitely take a look at
the Date table. I have done similiar things with an Access database, but
didn't think about it for work.
Thanks to all for looking.
SP
"Omnibuzz" wrote:

> Hi,
> Pardon me for my ignorance, can you please elucidate with an example wha
t
> you are trying to achieve?
> --
> -Omnibuzz (The SQL GC)
> http://omnibuzz-sql.blogspot.com/
>|||Maybe, this should work.. If I understood it wrong.. correct me..
declare @.a datetime
set @.a = getdate() -- Date on which you are running the report
select
dateadd(mm,datediff(mm,0,dateadd(yy,-1,@.a)),0) as Begin_dt,
dateadd(mm,datediff(mm,0,@.a),0)-1 as end_dt
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/|||As written, the End_dt is midnight on the last day of the month, effectively
leaving out all entries for that day.
I would add one more dateadd step to include ALL times on the last day of th
e month (up to 23:59:59.997)
DECLARE @.Today datetime
SET @.Today = getdate() -- Date on which you are running the report
SELECT
dateadd( mm, datediff( mm, 0, dateadd( yy, -1, @.Today )), 0 ) AS 'Begin_Dt'
, dateadd( ms, -2, dateadd(mm, datediff( mm, 0, @.Today ), 0 ) ) AS 'End_Dt'
--
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message news:30BC1C01-180E-442C-8D
BE-15E9B60B0C08@.microsoft.com...
> Maybe, this should work.. If I understood it wrong.. correct me..
>
> declare @.a datetime
> set @.a = getdate() -- Date on which you are running the report
> select
> dateadd(mm,datediff(mm,0,dateadd(yy,-1,@.a)),0) as Begin_dt,
> dateadd(mm,datediff(mm,0,@.a),0)-1 as end_dt
>
> --
> -Omnibuzz (The SQL GC)
>
> http://omnibuzz-sql.blogspot.com/
>
>|||I think it would be cleaner to use the next month's start instead of 3 ms
earlier, and use < on the end_dt instead of <= (and obviously, don't use
between).
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%23KeXiJIlGHA.4660@.TK2MSFTNGP05.phx.gbl...
As written, the End_dt is midnight on the last day of the month, effectively
leaving out all entries for that day.
I would add one more dateadd step to include ALL times on the last day of
the month (up to 23:59:59.997)
DECLARE @.Today datetime
SET @.Today = getdate() -- Date on which you are running the report
SELECT
dateadd( mm, datediff( mm, 0, dateadd( yy, -1, @.Today )), 0 ) AS
'Begin_Dt'
, dateadd( ms, -2, dateadd(mm, datediff( mm, 0, @.Today ), 0 ) ) AS
'End_Dt'
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
news:30BC1C01-180E-442C-8DBE-15E9B60B0C08@.microsoft.com...
> Maybe, this should work.. If I understood it wrong.. correct me..
> declare @.a datetime
> set @.a = getdate() -- Date on which you are running the report
> select
> dateadd(mm,datediff(mm,0,dateadd(yy,-1,@.a)),0) as Begin_dt,
> dateadd(mm,datediff(mm,0,@.a),0)-1 as end_dt
> --
> -Omnibuzz (The SQL GC)
> http://omnibuzz-sql.blogspot.com/
>|||Agreed.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:OhBC5SIlGHA.984@.TK2MSFTNGP05.phx.gbl...
>I think it would be cleaner to use the next month's start instead of 3 ms
>earlier, and use < on the end_dt instead of <= (and obviously, don't use
>between).
>
> "Arnie Rowland" <arnie@.1568.com> wrote in message
> news:%23KeXiJIlGHA.4660@.TK2MSFTNGP05.phx.gbl...
> As written, the End_dt is midnight on the last day of the month,
> effectively leaving out all entries for that day.
> I would add one more dateadd step to include ALL times on the last day of
> the month (up to 23:59:59.997)
> DECLARE @.Today datetime
> SET @.Today = getdate() -- Date on which you are running the report
> SELECT
> dateadd( mm, datediff( mm, 0, dateadd( yy, -1, @.Today )), 0 ) AS
> 'Begin_Dt'
> , dateadd( ms, -2, dateadd(mm, datediff( mm, 0, @.Today ), 0 ) ) AS
> 'End_Dt'
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another certification Exam
>
> "Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
> news:30BC1C01-180E-442C-8DBE-15E9B60B0C08@.microsoft.com...
>sql

Thursday, March 8, 2012

Creating query without transaction log

Is there a way to avoid writing transaction log?
We are an OLAP shop and we do not necessarily need transaction log while querying a 33gb data.
These type of queries capture an enormous amount of transaction log. If something happen, we can always restart the query, the log has minimal use for us. It is only filling up a huge amount of disk space. I truncate and shrink my database
everytime I am close of running out of space to keep these log to the minimum.
Any help is greatly appreciated.
Thanks,
Tony
Tony,
What is the recovery model?
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Tony - ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:F343EA26-32F7-4456-A907-12EAF14E32DE@.microsoft.com...
> Is there a way to avoid writing transaction log?
> We are an OLAP shop and we do not necessarily need transaction log while
querying a 33gb data.
> These type of queries capture an enormous amount of transaction log. If
something happen, we can always restart the query, the log has minimal use
for us. It is only filling up a huge amount of disk space. I truncate and
shrink my database
> everytime I am close of running out of space to keep these log to the
minimum.
> Any help is greatly appreciated.
> Thanks,
> Tony
|||Recovery model is Simple.
|||I would try putting the database into Read-only mode.
|||You need to find out what is causing the log to grow. SQL Server doesn't log SELECT statements, so it has to
be something else. Some operations can be done in minimal logging mode, but that is restrictive (bulk load
operations, SELECT INTO and index creations and rebuilds).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Tony - ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:D5623FAA-EA57-4D43-BF91-8F8B866A90C8@.microsoft.com...
> Recovery model is Simple.

Creating query without transaction log

Is there a way to avoid writing transaction log?
We are an OLAP shop and we do not necessarily need transaction log while que
rying a 33gb data.
These type of queries capture an enormous amount of transaction log. If some
thing happen, we can always restart the query, the log has minimal use for u
s. It is only filling up a huge amount of disk space. I truncate and shrink
my database
everytime I am close of running out of space to keep these log to the minim
um.
Any help is greatly appreciated.
Thanks,
TonyTony,
What is the recovery model?
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Tony - ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:F343EA26-32F7-4456-A907-12EAF14E32DE@.microsoft.com...
> Is there a way to avoid writing transaction log?
> We are an OLAP shop and we do not necessarily need transaction log while
querying a 33gb data.
> These type of queries capture an enormous amount of transaction log. If
something happen, we can always restart the query, the log has minimal use
for us. It is only filling up a huge amount of disk space. I truncate and
shrink my database
> everytime I am close of running out of space to keep these log to the
minimum.
> Any help is greatly appreciated.
> Thanks,
> Tony|||Recovery model is Simple.|||I would try putting the database into Read-only mode.|||You need to find out what is causing the log to grow. SQL Server doesn't log
SELECT statements, so it has to
be something else. Some operations can be done in minimal logging mode, but
that is restrictive (bulk load
operations, SELECT INTO and index creations and rebuilds).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Tony - ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:D5623FAA-EA57-4D43-BF91-8F8B866A90C8@.microsoft.com...
> Recovery model is Simple.

Creating query without transaction log

Is there a way to avoid writing transaction log?
We are an OLAP shop and we do not necessarily need transaction log while querying a 33gb data
These type of queries capture an enormous amount of transaction log. If something happen, we can always restart the query, the log has minimal use for us. It is only filling up a huge amount of disk space. I truncate and shrink my databas
everytime I am close of running out of space to keep these log to the minimum
Any help is greatly appreciated
Thanks
TonyTony,
What is the recovery model?
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Tony - ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:F343EA26-32F7-4456-A907-12EAF14E32DE@.microsoft.com...
> Is there a way to avoid writing transaction log?
> We are an OLAP shop and we do not necessarily need transaction log while
querying a 33gb data.
> These type of queries capture an enormous amount of transaction log. If
something happen, we can always restart the query, the log has minimal use
for us. It is only filling up a huge amount of disk space. I truncate and
shrink my database
> everytime I am close of running out of space to keep these log to the
minimum.
> Any help is greatly appreciated.
> Thanks,
> Tony|||Recovery model is Simple.|||I would try putting the database into Read-only mode.|||You need to find out what is causing the log to grow. SQL Server doesn't log SELECT statements, so it has to
be something else. Some operations can be done in minimal logging mode, but that is restrictive (bulk load
operations, SELECT INTO and index creations and rebuilds).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Tony - ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:D5623FAA-EA57-4D43-BF91-8F8B866A90C8@.microsoft.com...
> Recovery model is Simple.

Sunday, February 19, 2012

Creating Fireign Keys....How?

Hi!!
How I can create foreign keys using Enterprise Manager without writing any
SQL commands'
Thanks in advance!
TimurHi,
Inside the table creation option from Enterprise manager, click the manage
relationship icon.
Thanks
Hari
MCDBA
"" <tim_@.pochtamt.ru> wrote in message
news:Oa3RUvY8DHA.2560@.TK2MSFTNGP09.phx.gbl...
> Hi!!
> How I can create foreign keys using Enterprise Manager without writing any
> SQL commands'
> Thanks in advance!
> Timur
>

Creating Fireign Keys....How?

Hi!!
How I can create foreign keys using Enterprise Manager without writing any
SQL commands'
Thanks in advance!
TimurHi,
Inside the table creation option from Enterprise manager, click the manage
relationship icon.
Thanks
Hari
MCDBA
"ôÉÍÕÒ" <tim_@.pochtamt.ru> wrote in message
news:Oa3RUvY8DHA.2560@.TK2MSFTNGP09.phx.gbl...
> Hi!!
> How I can create foreign keys using Enterprise Manager without writing any
> SQL commands'
> Thanks in advance!
> Timur
>