Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4547204
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:03:40+00:00 2026-05-21T16:03:40+00:00

How can I programmatically detect whether the current user has CREATE TABLE permissions in

  • 0

How can I programmatically detect whether the current user has CREATE TABLE permissions in the current database?

I’m writing a tool that will do some lengthy processing, and then create database tables to save the results. I only want to create the tables if the processing runs to completion. But if the user won’t be able to create the tables, there’s no point spending time processing. I’d like to detect the permission issue and fail fast.

This will be from a C# application, and I can’t assume that any special libraries will be installed, which probably rules out SQL-DMO and SMO. If there’s an easy way to check permissions with a T-SQL query/script, that would be ideal.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:03:41+00:00Added an answer on May 21, 2026 at 4:03 pm

    Why not create the table first, and if that fails, go no further?

    That said, you can also use the following function HAS_PERMS_BY_NAME:

    SELECT HAS_PERMS_BY_NAME(db_name(), 'DATABASE', 'CREATE TABLE');
    

    More information here:

    http://msdn.microsoft.com/en-us/library/ms189802.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way that I can programmatically create (and I guess access) hidden
How can I programmatically detect whether or not two triangles touch each other, given
I've got an input box that allows UTF8 characters -- can I detect whether
How can I detect programmatically if a phone has a camera ?
How can I programatically detect if MSMQ has been installed on the current system?
In my C++ program, how can I detect programmatically at runtime whether symbols have
My Cocoa app needs some small dynamically generated windows. How can I programmatically create
Possible Duplicate: Best way to programmatically detect iPad/iPhone hardware How can I differentiate the
how can I detect whether I'm using iphone simulator or ipad simulator. I'm using
My application has to detect that the device connected to the Wi-Fi network is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.