Forum Replies Created

Viewing 15 posts - 181 through 195 (of 583 total)

  • RE: Map login to users

    what you did do should have worked. just tested and it worked find on my machine.

    you can check the associated user and logins to see if the goodusername user is...

  • RE: SQL Function to remove excess characters

    I'll tweak it a little more

    SELECT distinct CASE WHEN LEFT(OrderNo,CHARINDEX('-',OrderNo,4)) =''

    THEN OrderNo

    ELSE substring(OrderNo,1,CHARINDEX('-',OrderNo,4)-1)

    END AS NoSuffix

    FROM (

    SELECT 'SO-123456' AS OrderNo

    UNION ALL

    SELECT 'SO-123456-01'

    UNION ALL

    SELECT 'SO-123456-2'

    UNION ALL

    SELECT 'SO-123457'

    UNION ALL

    SELECT 'SO-123457-1'

    UNION ALL

    SELECT 'SO-123457-02'

    UNION ALL

    SELECT...

  • RE: t-sql max date

    without DDL, sample data, and expected results it makes it difficult to give you an answer. Check the link in my signature on how to post to get the best...

  • RE: SQL Server 2012 Server Collation vs. Database Collation

    If the server and database collation are different then anything created in tempdb will have the server collation which wont match the database collation. So you are right in think...

  • RE: Database Role permissions

    Here is an example using a DDL trigger

    CREATE TRIGGER procperm ON DATABASE

    FOR CREATE_PROCEDURE

    AS

    DECLARE

    @proc varchar(255),

    @sql nvarchar(max);

    SELECT @proc = EVENTDATA().value('(/EVENT_INSTANCE/SchemaName)[1]', 'nvarchar(max)')...

  • RE: Cast as varbinary?

    you basically have the answer in the title.

    create table #tmp(col1 varchar(10))

    INSERT INTO #tmp

    values('CAT')

    SELECT col1,cast(col1 as varbinary(max))

    from #tmp

  • RE: OS Disk Capacity Information

    Jeff Moden (2/7/2014)


    My problem is that I'm still stuck with 2005 at work (apologies for forgetting to mention that on a 2K12 forum). CMS isn't possible for me at...

  • RE: OS Disk Capacity Information

    Jeff Moden (2/7/2014)


    My problem is that I'm still stuck with 2005 at work (apologies for forgetting to mention that on a 2K12 forum). CMS isn't possible for me at...

  • RE: OS Disk Capacity Information

    Jeff Moden (2/7/2014)


    Robert klimes (2/6/2014)


    try this out

    $ds = New-Object system.Data.DataSet

    $ds = Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" -computer (Get-Content c:\computers.txt) | Select SystemName,DeviceID,VolumeName,@{Name="size"; Expression={"{0:N1}" -f($_.size/1gb)}},@{Name="freespace";Expression={"{0:N1}" -f($_.freespace/1gb)}}

    foreach ($d in $ds)

    {

    $systemname = $d.systemname

    $deviceID...

  • RE: OS Disk Capacity Information

    I usually do something like the following to get the date.

    $date = Get-Date -Format "yyyyMMdd"

    here is article about powershell date formatting

    http://technet.microsoft.com/en-us/library/ee692801.aspx

  • RE: OS Disk Capacity Information

    try this out

    $ds = New-Object system.Data.DataSet

    $ds = Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" -computer (Get-Content c:\computers.txt) | Select SystemName,DeviceID,VolumeName,@{Name="size"; Expression={"{0:N1}" -f($_.size/1gb)}},@{Name="freespace";Expression={"{0:N1}" -f($_.freespace/1gb)}}

    foreach ($d in $ds)

    {

    $systemname = $d.systemname

    $deviceID = $d.DeviceID

    $volumename = $d.volumename

    $size...

  • RE: OS Disk Capacity Information

    post what you have so far and i'll see if I can fill in the gaps.

  • RE: Sysjobhistory - Step Fails but Job (Step 0) reports as successful

    If it's only a couple of seconds that is the issue and you don't have jobs that run multiple time a minute you could zero out the seconds in the...

  • RE: OS Disk Capacity Information

    I second Jeff's suggestion that powershell is the way to go. this is the script that I have built my free space report off of.

    http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/03/01/getting-partition-offset-information-with-powershell.aspx

  • RE: Sysjobhistory - Step Fails but Job (Step 0) reports as successful

    If I understood correctly,I think something like this would be what you are looking for. I didnt have any jobs in this state so i just created a test job...

Viewing 15 posts - 181 through 195 (of 583 total)