how to set to a variable

  • how can I make SELECT SERVERPROPERTY('MachineName')  to set to a variable?

    Thanks,

  • Google-fu not working? See this page...

    use tempdb;
    go
    DECLARE @MyMachine NVARCHAR(128);
    SELECT @MyMachine = CAST(SERVERPROPERTY('MachineName') AS NVARCHAR(128))
    PRINT @MyMachine + ' is a piece of junk';

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

You must be logged in to reply to this topic. Login to reply