Premission to create database!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ilamparithi

    Premission to create database!

    Hi all,

    How to determine whether a user has the right to create a databse in
    MS SQL Server programatically .

    With Regards,
    A.Ilamparithi.
  • Simon Hayes

    #2
    Re: Premission to create database!


    "Ilamparith i" <ilamparithi@ms n.com> wrote in message
    news:f5606ff9.0 404140542.53a28 6ea@posting.goo gle.com...[color=blue]
    > Hi all,
    >
    > How to determine whether a user has the right to create a databse in
    > MS SQL Server programatically .
    >
    > With Regards,
    > A.Ilamparithi.[/color]

    See the PERMISSIONS() function in Books Online:

    IF SELECT PERMISSIONS() & 1 = 1
    PRINT 'Can create a database'

    Note that you must be in the master database for this to work.

    Simon


    Comment

    • Ilamparithi

      #3
      Re: Premission to create database!

      "Simon Hayes" <sql@hayes.ch > wrote in message news:<407d490a$ 1_3@news.bluewi n.ch>...[color=blue]
      > "Ilamparith i" <ilamparithi@ms n.com> wrote in message
      > news:f5606ff9.0 404140542.53a28 6ea@posting.goo gle.com...[color=green]
      > > Hi all,
      > >
      > > How to determine whether a user has the right to create a databse in
      > > MS SQL Server programatically .
      > >
      > > With Regards,
      > > A.Ilamparithi.[/color]
      >
      > See the PERMISSIONS() function in Books Online:
      >
      > IF SELECT PERMISSIONS() & 1 = 1
      > PRINT 'Can create a database'
      >
      > Note that you must be in the master database for this to work.
      >
      > Simon[/color]

      Thanks Simon.

      This is what i was looking for.

      With Thanks,
      A.Ilamparithi.

      Comment

      • Ilamparithi

        #4
        Re: Premission to create database!

        "Simon Hayes" <sql@hayes.ch > wrote in message news:<407d490a$ 1_3@news.bluewi n.ch>...[color=blue]
        > "Ilamparith i" <ilamparithi@ms n.com> wrote in message
        > news:f5606ff9.0 404140542.53a28 6ea@posting.goo gle.com...[color=green]
        > > Hi all,
        > >
        > > How to determine whether a user has the right to create a databse in
        > > MS SQL Server programatically .
        > >
        > > With Regards,
        > > A.Ilamparithi.[/color]
        >
        > See the PERMISSIONS() function in Books Online:
        >
        > IF SELECT PERMISSIONS() & 1 = 1
        > PRINT 'Can create a database'
        >
        > Note that you must be in the master database for this to work.
        >
        > Simon[/color]

        Thanks Simon.

        This is what i was looking for.

        With Thanks,
        A.Ilamparithi.

        Comment

        Working...