473,396 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Jul 20 '05 #1
3 1960

"Ilamparithi" <il*********@msn.com> wrote in message
news:f5**************************@posting.google.c om...
Hi all,

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

With Regards,
A.Ilamparithi.


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
Jul 20 '05 #2
"Simon Hayes" <sq*@hayes.ch> wrote in message news:<40**********@news.bluewin.ch>...
"Ilamparithi" <il*********@msn.com> wrote in message
news:f5**************************@posting.google.c om...
Hi all,

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

With Regards,
A.Ilamparithi.


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


Thanks Simon.

This is what i was looking for.

With Thanks,
A.Ilamparithi.
Jul 20 '05 #3
"Simon Hayes" <sq*@hayes.ch> wrote in message news:<40**********@news.bluewin.ch>...
"Ilamparithi" <il*********@msn.com> wrote in message
news:f5**************************@posting.google.c om...
Hi all,

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

With Regards,
A.Ilamparithi.


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


Thanks Simon.

This is what i was looking for.

With Thanks,
A.Ilamparithi.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
1
by: Ilamparithi | last post by:
Hi all, How to determine whether a user has the right to create a databse in MS SQL Server programatically. With Regards, A.Ilamparithi.
4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
1
by: intl04 | last post by:
I am getting strange print-related error messages when trying to create (not print!) reports. For example, when I click 'new' to create a report then choose 'design view', I get an error message...
5
by: Hei | last post by:
Hi i'm try a asp.net web page that access msde, i think these problem is about premission. i have 1. added a login to msde named 'Database Users' and 2. grant windows user group 'Database...
9
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.