Forum Replies Created

Viewing 2 posts - 1 through 3 (of 3 total)

  • RE: How to find the SQL Server's FQDN using t-sql and insert into a field in a record

    Check this out!

    DECLARE @tblFQDNInfo TABLE( Value VARCHAR(8), Data VARCHAR(128))

    INSERT INTO @tblFQDNInfo

    EXEC [master]..xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\ControlSet001\Services\Tcpip\Parameters', N'Hostname'

    INSERT INTO @tblFQDNInfo

    EXEC [master]..xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\ControlSet001\Services\Tcpip\Parameters', N'Domain'

    SELECT tfi1.Data + N'.' + tfi2.Data FQDN

    FROM @tblFQDNInfo tfi1, ...

  • RE: truncate string

    DECLARE @String VARCHAR(32) = N'shfdiuf/lsdfsjfij'

    SELECTLEFT(@String, CHARINDEX(N'/', @String) - 1),

    RIGHT(@String, CHARINDEX(N'/', @String) + 1)

Viewing 2 posts - 1 through 3 (of 3 total)