From: Ada on
The requested format is
ROG_SQL_Server_<machine name>_<SQL Server name>_<timestamp>.out

--
SQL Server DBA


"Erland Sommarskog" wrote:

> Ada (Ada(a)discussions.microsoft.com) writes:
> > I just want to see host names of the connected SQL Server in the output
> > file names. It's part of the requirements to cover named instance,
> > clusters etc.
>
> But does c:\iSEC\OUT2005\ROG_SQL_Server_%%a_%dt%%tm%.out not meet that
> bill?
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
> .
>
From: Dan on
If %%a is the target (eg \\MACHINE\INSTANCE) why do you even need to bother?

If it's really that important, look for string handling in a DOS batch to
split the %%a variable into it's parts and use the first part as the machine
name.

Or alternatively look at using other methods of scripting this, such as
Windows Scripting Host or PowerShell, where string handling is much easier
to deal with.

Dan



"Ada" <Ada(a)discussions.microsoft.com> wrote in message
news:31BB55F1-846E-4E38-85E2-98F3B5998747(a)microsoft.com...
> The requested format is
> ROG_SQL_Server_<machine name>_<SQL Server name>_<timestamp>.out
>
> --
> SQL Server DBA
>
>
> "Erland Sommarskog" wrote:
>
>> Ada (Ada(a)discussions.microsoft.com) writes:
>> > I just want to see host names of the connected SQL Server in the output
>> > file names. It's part of the requirements to cover named instance,
>> > clusters etc.
>>
>> But does c:\iSEC\OUT2005\ROG_SQL_Server_%%a_%dt%%tm%.out not meet that
>> bill?
>>
>>
>> --
>> Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se
>>
>> Books Online for SQL Server 2005 at
>> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>> Books Online for SQL Server 2000 at
>> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>> .
>>



From: Ada on
\\MACHINE\INSTANCE works except on clustered instances.
I'll check if it is really worth the additional effort.

Thanks,

--
SQL Server DBA


"Dan" wrote:

> If %%a is the target (eg \\MACHINE\INSTANCE) why do you even need to bother?
>
> If it's really that important, look for string handling in a DOS batch to
> split the %%a variable into it's parts and use the first part as the machine
> name.
>
> Or alternatively look at using other methods of scripting this, such as
> Windows Scripting Host or PowerShell, where string handling is much easier
> to deal with.
>
> Dan
>
>
>
> "Ada" <Ada(a)discussions.microsoft.com> wrote in message
> news:31BB55F1-846E-4E38-85E2-98F3B5998747(a)microsoft.com...
> > The requested format is
> > ROG_SQL_Server_<machine name>_<SQL Server name>_<timestamp>.out
> >
> > --
> > SQL Server DBA
> >
> >
> > "Erland Sommarskog" wrote:
> >
> >> Ada (Ada(a)discussions.microsoft.com) writes:
> >> > I just want to see host names of the connected SQL Server in the output
> >> > file names. It's part of the requirements to cover named instance,
> >> > clusters etc.
> >>
> >> But does c:\iSEC\OUT2005\ROG_SQL_Server_%%a_%dt%%tm%.out not meet that
> >> bill?
> >>
> >>
> >> --
> >> Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se
> >>
> >> Books Online for SQL Server 2005 at
> >> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> >> Books Online for SQL Server 2000 at
> >> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
> >> .
> >>
>
>
>
> .
>
From: Erland Sommarskog on
Ada (Ada(a)discussions.microsoft.com) writes:
> \\MACHINE\INSTANCE works except on clustered instances.
> I'll check if it is really worth the additional effort.

If you want both names, both names have to be in the file, and then
you need to split it some how.

And if you have name instances, you need to find out how to handle
the backslash.


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

From: Dan on

"Erland Sommarskog" <esquel(a)sommarskog.se> wrote in message
news:Xns9DA8EEF8E621CYazorman(a)127.0.0.1...
> Ada (Ada(a)discussions.microsoft.com) writes:
>> \\MACHINE\INSTANCE works except on clustered instances.
>> I'll check if it is really worth the additional effort.
>
> If you want both names, both names have to be in the file, and then
> you need to split it some how.
>
> And if you have name instances, you need to find out how to handle
> the backslash.
>

Good point - I'd forgotten that %%a would include the slashes and so result
in an invalid filename ...

--
Dan