Loading ...
Sorry, an error occurred while loading the content.
 

Re: MUGH-SQLCON Problem with my Query

Expand Messages
  • vijayasekar shanmughasundharaj
    In the if condition replace NULL with your system name ,as when you select @@ servername if its default instance you can see your box name Thanks Vijayasekar
    Message 1 of 6 , Sep 10, 2007
      In the if condition replace NULL with your system name ,as when you select
      @@ servername if its default instance you can see your box name

      Thanks
      Vijayasekar

      On 9/10/07, Vidhya Sagar <kvs1983@...> wrote:
      >
      > Hi All,
      >
      > I've written the below query to find out default or named instance. When I
      > execute the query in default instance(SQL 2005) , I'm getting output as
      > 'NAMED Instance'. Can anyone check this and tell me why it is not showing
      > output as Default instance.
      >
      > if (serverproperty('instancename'))=NULL
      >
      > begin
      >
      > Print 'Default Instance'
      >
      > end
      >
      > else
      >
      > begin
      >
      > Print 'Named Instance'
      >
      > end
      >
      > Cheers.....Vidhya Sagar.....+91 98843 97975
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >



      --
      Thanks
      Vijayasekar


      [Non-text portions of this message have been removed]
    • Vidhya Sagar
      Hi, You are right, but some of my SQL servers name will be NULL. Hence below is the right choice. sagar From: sqlcon@yahoogroups.com
      Message 2 of 6 , Sep 10, 2007
        Hi,



        You are right, but some of my SQL servers name will be NULL.

        Hence below is the right choice.



        sagar



        From: sqlcon@yahoogroups.com [mailto:sqlcon@yahoogroups.com] On Behalf Of
        vijayasekar shanmughasundharaj
        Sent: Monday, September 10, 2007 2:32 PM
        To: sqlcon@yahoogroups.com
        Subject: Re: MUGH-SQLCON Problem with my Query



        In the if condition replace NULL with your system name ,as when you select
        @@ servername if its default instance you can see your box name

        Thanks
        Vijayasekar

        On 9/10/07, Vidhya Sagar <kvs1983@... <mailto:kvs1983%40gmail.com> >
        wrote:
        >
        > Hi All,
        >
        > I've written the below query to find out default or named instance. When I
        > execute the query in default instance(SQL 2005) , I'm getting output as
        > 'NAMED Instance'. Can anyone check this and tell me why it is not showing
        > output as Default instance.
        >
        > if (serverproperty('instancename'))=NULL
        >
        > begin
        >
        > Print 'Default Instance'
        >
        > end
        >
        > else
        >
        > begin
        >
        > Print 'Named Instance'
        >
        > end
        >
        > Cheers.....Vidhya Sagar.....+91 98843 97975
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >

        --
        Thanks
        Vijayasekar

        [Non-text portions of this message have been removed]





        [Non-text portions of this message have been removed]
      • mohd rizwan
        Sagar........use IF condition like this IF (serverproperty( instancename )) is NULL Rizwan............... Vidhya Sagar wrote: Hi, You are
        Message 3 of 6 , Sep 10, 2007
          Sagar........use IF condition like this

          IF (serverproperty( 'instancename' )) is NULL


          Rizwan...............

          Vidhya Sagar <kvs1983@...> wrote:
          Hi,

          You are right, but some of my SQL servers name will be NULL.

          Hence below is the right choice.

          sagar

          From: sqlcon@yahoogroups.com [mailto:sqlcon@yahoogroups.com] On Behalf Of
          vijayasekar shanmughasundharaj
          Sent: Monday, September 10, 2007 2:32 PM
          To: sqlcon@yahoogroups.com
          Subject: Re: MUGH-SQLCON Problem with my Query

          In the if condition replace NULL with your system name ,as when you select
          @@ servername if its default instance you can see your box name

          Thanks
          Vijayasekar

          On 9/10/07, Vidhya Sagar <kvs1983@... <mailto:kvs1983%40gmail.com> >
          wrote:
          >
          > Hi All,
          >
          > I've written the below query to find out default or named instance. When I
          > execute the query in default instance(SQL 2005) , I'm getting output as
          > 'NAMED Instance'. Can anyone check this and tell me why it is not showing
          > output as Default instance.
          >
          > if (serverproperty('instancename'))=NULL
          >
          > begin
          >
          > Print 'Default Instance'
          >
          > end
          >
          > else
          >
          > begin
          >
          > Print 'Named Instance'
          >
          > end
          >
          > Cheers.....Vidhya Sagar.....+91 98843 97975
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >

          --
          Thanks
          Vijayasekar

          [Non-text portions of this message have been removed]

          [Non-text portions of this message have been removed]





          Send instant messages to your online friends http://uk.messenger.yahoo.com

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.