Forum Replies Created

Viewing 15 posts - 106 through 120 (of 907 total)

  • RE: %COMPUTERNAME% does not work

    The %username% produces the following error if run through sql agent:

    Login failed for user '%username%'.

    But works if run through xp_cmdshell.

    So basically I'm guessing no environment variables get replaced with there...

  • RE: %COMPUTERNAME% does not work

    It returns the computer name on which the command runs. Why are you asking?

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a copy here:...

  • RE: %COMPUTERNAME% does not work

    No, not running this on a cluster.

    Thanks for the solution, that would work, as well as the one provided by mccork.

    Really I was wondering if anyone know why...

  • RE: %COMPUTERNAME% does not work

    Wonder why starting a new shell makes a difference in a SQL Agent job?

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a copy here: http://www.sqlservercentral.com/bestof/

    Need...

  • RE: Script out logins and users

    Here is an article I wrote that might give you another method of scripting login migrations:

    http://www.sqlservercentral.com/columnists/glarsen/migratingloginstoanotherserver.asp

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a copy...

  • RE: Bit Comparison

    Think you want something like this:

    create table t1(c1 int, c2 char(5), c3 char(5))

    insert into t1 values(1, '0100T', '9999T')

    insert into t1 values(2, '00000', '09999')

    insert into t1 values(3, '10000', '69999')

    select * from...

  • RE: Min, Max and Average Row Size Tool

    oops. found a bug, try this one:

    ----------------------------------------------------------------

    -- Display average row size for each table in a database

    -- Author: Greg Larsen Date: 12/18/2003

    ----------------------------------------------------------------

    set nocount on

    declare @old_tname varchar(100)

    declare...

  • RE: Min, Max and Average Row Size Tool

    Sorry about that blank post. Ok took a stab at creating the Average Records Length query. I use the information in sp_spaceused to calculate the average. ...

  • RE: Min, Max and Average Row Size Tool

    quote:


    I'm looking for a tool that would calculate the min, max and average row size of a table. This tool would...

  • RE: Point in Time restore problem

    More information about the book can be found here:

    http://www.sqlservercentral.com/bestof/

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a copy here: http:www.sqlservercentral.com/bestof/purchase.asp

    Need SQL Server Examples check out...

  • RE: Point in Time restore problem

    When you do a point in time restore the database will be restored to that point in time. Now if you can identify the corrupted transaction and the data...

  • RE: Statistics with _WA and hind_ In Their Name

    Now there is a bold suggestion. Would you consider deleting records manually for a system table as a "good practice" or one of those "bad practices".

    My normal...

  • RE: How to get Time from Getdate()

    Might try something like this:

    select substring(convert(char(30),getdate(),109),13,8) +

    ' ' + substring(convert(char(30),getdate(),109),25,2)

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a...

  • RE: Record Number

    Some other options for doing what you want can be found my article posted here:

    http://www.sqlservercentral.com/columnists/glarsen/sequentialnumbering.asp

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a copy here:...

  • RE: Number of Transactions per day

    You might also look into using the "Batch Requests/sec" in smaster..sysperfinfo table

    Gregory A. Larsen, DBA

    Contributor to 'The Best of SQLServerCentral.com 2002' book. Get a copy here: http:www.sqlservercentral.com/bestof/purchase.asp

    Need SQL Server...

Viewing 15 posts - 106 through 120 (of 907 total)