List User Tables

Apr 14, 2001

I'm brain-dead today, sadly. If it weren't for IE remembering previous entries, I don't know if my name and email would have made it into the header correct :-)

I want the SQL command that lists the names of all user tables.

Alternatively, I have the following problematic Access 2000 code:

Public Sub ListAllTables()
Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table
Dim cnn As New ADODB.Connection
Dim i As Integer, j As Integer
Dim vgRet As Variant
Dim intPrefixLen As Integer
Dim strAppend As String

DoCmd.Hourglass True
cnn.Open CurrentProject.Connection
cat.ActiveConnection = CurrentProject.Connection
intPrefixLen = Len(CON_pkgPrefix)

Debug.Print cat.Tables.Count

For j = (cat.Tables.Count - 1) To 0 Step -1
Set tbl = cat.Tables(j)
With tbl
Debug.Print tbl.Name
vgRet = SysCmd(acSysCmdSetStatus, tbl.Name)
End With
Next

Set tbl = Nothing
Set cnn = Nothing
Set cat = Nothing
DoCmd.Hourglass False
vgRet = SysCmd(acSysCmdSetStatus, " ")
End Sub

This code runs fine against an MDB but against SQL it includes all the views, rather than just the tables. If you have a fix for this, that will do just fine!

Arthur

View 1 Replies


ADVERTISEMENT

Find The List Of Tables For A User?

Feb 18, 2015

how to find the names of the tables owned by the particular user in sql server and how to display the distinct object types owned by the particular user.

View 1 Replies View Related

How Can I Use The GetSchema To Get A List Of Only User Tables And Views.

Apr 26, 2006

How can I use the GetSchema method new in 2.0 to get a list of only user tables and views.

View 6 Replies View Related

How To Find Out The List Of All Tables And Views Owned By A Particular User In Any Database?

Oct 15, 2001

How to find out the list of all tables and views owned by a particular user in any database by querying the system tables?Thanks.

View 2 Replies View Related

How Do We Determine Which User Database Tables Are Mostly Retrieved By User Or Modified By User?

May 22, 2008



Hi,
Please give the T-SQL script for this ? Thanks

Shanth


View 4 Replies View Related

SQL 2012 :: How To Grant A New User Same Direct Privilege To Tables As Existing User

Feb 18, 2014

I am relatively new to sql developer. There is a new user that just joined our organization. I am trying to grant him the same direct grants privilege to the tables that an existing user has. The existing user has a ton of direct table access privileges and it will take days if I had to do each grant one by one like: grant select,insert,delete,update on 'table name' to 'user id'. Is there a way of copying or inserting an existing user's privilege and granting it to a new user.

View 2 Replies View Related

DBO Invisible In User List

Mar 20, 2002

Recently found a situation which I can not figure out the cause. Wish somebody can help me here.

The scenario is as follows:

Server: SQL 7.0 with SP2
login name: DBA, standard SQL login, member of sysadmins
DB Name: TEST

DBA is the owner of database TEST and a member of db_owners in the database. Using EM, if you look at Users in TEST database, the only entry you can find is DBA where both Names (user name Login Name) are the same: DBA. There's no entry for user dbo. (from BOL, dbo can not be deleted)

Run sp_helpuser gives out two rows.
user login name
dbo NULL
DBA DBA

I don't know what happened to this machine before. Any clue about the possible cause is highly appreciated.

Hong

View 1 Replies View Related

User Permission List

Apr 28, 2006

Hi, Does anyone has a script to get user permissions on all tables?
Thanks

View 8 Replies View Related

List Of User Sp From Master Db

Jun 15, 2006

Is their any sql to find the list of sp created by user's in master db?

View 9 Replies View Related

List Available Reports For A User

Feb 11, 2008



Hi there,

Don't know if anyone has done this before -and I would really be wondered if not-:
I want to show a list of available reports to a user. Since we are working with SharePoint Portal Server 2003 the webparts can't be used (need MOSS 2007 or WSS 3.0), but I really need to be able to build a dynamically generated list and show it on a sharepoint page.

My first idea is to build a report (kind of menu). I am already this far:

to get a list of reports with the active directory groups and their mapped roles:
select u.UserName, c.Path, r.RoleName

from PolicyUserRole pur

left join Users u on pur.userID=u.userID

left join Roles r on pur.roleID=r.roleID

left join Catalog c on pur.policyID=c.policyID

order by u.UserName, c.Path, r.RoleName


I managed to link active directory via LDAP - linked server.
I even managed to get a list of users and groups. Unfortunately I cannot check whether a user belongs to a group (any idea?), since all of our security (on sql server) is managed by active directory groups this really is a problem.

Or am I completely wrong and is there another way to fetch a list of reports for a user?

Any help would be great!

Thanks,
Tom

View 1 Replies View Related

Create A List If User

Jun 1, 2007

Hi there,



Can someone please help me how to generate the list of all "user" in a database and it's access role? really need it . .



Thanks

View 3 Replies View Related

Database List For The Currently Logged In User

Jul 11, 2004

I can get a list of all databases in SQL Server using

sqlText = "select name from sysdatabases order by name".

How can I get such a list for the currently logged in user only?

Thanks in advance

Harold Hoffman

View 1 Replies View Related

How To List All The Objects That An User Has Access To?

Aug 27, 2004

Is there anyway, that I can generate a list of all the objects that a given user has access to (including type of access whether select or update etc), by running a SQL command? One of our databases has nearly 40,000 tables (no kidding!) I can always find this out by manually looking into the roles etc on the enterprise manager, but I need a way to find out using a T-SQL query..Thanks for any help!

View 2 Replies View Related

List All Databases That A User Has Access To

Nov 17, 2014

Any way to list all databases that a user has access to?

View 6 Replies View Related

User List With First Activated Offer

Nov 27, 2013

I have 3 tables, please find the table structure and sample data below

Table 1 : tblUserInfo

UserID | FirstName | Email | JoinedDate

1 Testuser01 User01@User.com 10-10-2013
2 Testuser10 User10@User.com 11-10-2013
3 Testuser20 User10@User.com 11-10-2013

Table 2 : tblOffers

OfferID | OfferName | ExpiryDate

1 OfferSample1 15-10-2014
2 OfferSample2 15-9-2014
3 OfferSample3 10-07-2014

Table 3 :tblOfferActivated

ActivationID | UserID | OfferID | ActivationCode | ActivatedDate

1 2 3 ABC 11-11-2013
2 2 1 CEG 13-11-2013
3 3 1 JHG 18-11-2013
4 3 2 KIU 20-11-2013

Expected Output

I want to list out the users with the first activated offer details.The OfferName Should be based on the first activated date

UserID | FirstName | Email | JoinedDate | OfferID | OfferName |ActivatedDate | ActivationCode

1 Testuser01 User01@User.com 10-10-2013 Null Null Null Null
2 Testuser10 User10@User.com 11-10-2013 3 OfferSample2 11-11-2013 ABC
3 Testuser20 User10@User.com 11-10-2013 4 offerSample3 18-11-2013 JHG

View 6 Replies View Related

List All Databases That A User Has A Login

Nov 26, 2007

Hi everyone,
I have an instance with many databases in it. I am looking for the easiest way to see which of those databases a user has a login on. What is the most efficient way of doing this?
Thanks,
Anil

View 5 Replies View Related

Is There A Quick Way To Get A List Of Roles A User Is A Member Of?

Jul 23, 2005

What I'm looking for is a list of roles a particular user is a memberof.the closest I've found so far is sp_helprolemember without anyarguements. but this gives me all the roles and all the users. I wantthis same list filtered on a specific user.something like sp_??? 'user'

View 2 Replies View Related

SQL-DMO And C#: Retrieve The List Of User-Defined Functions

Apr 9, 2006

http://www.csharphelp.com/archives2/archive342.htmlI am using the sample code from this link but I amunable to figure out how to retrieve the list ofthe User-Defined Functions. I am able to get thecount of the user defined functions correctly using:db.ListObjects(SQLDMO.SQLDMO_OBJECT_TYPE.SQLDMOObj _UserDefinedFunction,SQLDMO.SQLDMO_OBJSORT_TYPE.SQLDMOObjSort_Name).Cou ntbut I am unable to get to enumerate the function names.Then I tried to see if I can achieve what I want usingSQLObjectList but I was unsuccessful.Does someone know how I can do this using C#?Thank youThis is the full code I have:private void linkLabel5_LinkClicked(object sender,LinkLabelLinkClickedEventArgs e){this.Cursor = Cursors.WaitCursor;SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();srv.Connect(this.cboServers.SelectedItem.ToString( ), this.txtUser.Text,this.txtPassword.Text);for (int i = 0; i < srv.Databases.Count; i++){if (srv.Databases.Item(i + 1, "dbo").Name ==this.cboDatabase.SelectedItem.ToString()){SQLDMO._Database db = srv.Databases.Item(i + 1, "dbo");this.lstObjects.Items.Clear();SQLDMO.SQLObjectList sqludf;sqludf =db.ListObjects(SQLDMO.SQLDMO_OBJECT_TYPE.SQLDMOObj _UserDefinedFunction,SQLDMO.SQLDMO_OBJSORT_TYPE.SQLDMOObjSort_Name);for (int j = 0; j < sqludf.Count; j++){//this.lstObjects.Items.Add(db.ListObjects(SQLDMO.SQ LDMO_OBJECT_TYPE.SQLDMOObj_UserDefinedFunction,SQLDMO.SQLDMO_OBJSORT_TYPE.SQLDMOObjSort_Name).Ite m(j + 1, "dbo").Name);}this.Cursor = Cursors.Default;return;}}this.Cursor = Cursors.Default;}

View 4 Replies View Related

Stored Procedure To List Out User Access

Jan 19, 2008

Is there a built in stored procedure that would allow me to list outthe database permissions assigned to a particular user or role?

View 2 Replies View Related

How To Generate Any Report That The User Selects From A List

Oct 10, 2007



I know this a simple question but I cannot find an example of using the ReportExecutionService to render a report that doesn't take any parameters. Can somebody provide and example? Or to make it easier, tell me what to change in the msdn example: http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx


Thanks in advance,

Chris

View 1 Replies View Related

How To List The User Objects In Sql Server 2000

Mar 24, 2008



hi all

i am using sysobjects for taking the list of user objects.

by using userid, status column combinations, able to take out the user tables/triggers/views
but for stored procedures, it doesn't work.

is there any better way to list the user objects.

thanks in advance.
sam alex

View 3 Replies View Related

How Do I Get A List Of Tables In T-SQL

Mar 11, 2005

Hi,
Is there anything equivalent to Oracle's Select * from tab in MS SQL.

View 2 Replies View Related

How I Can Get List Of Tables?

Dec 24, 2005

Hi friends,
How I can get list of tables and list of fields within those tables in SQL server.
Thnak a lot.
 

View 4 Replies View Related

List Of Tables

Jun 6, 2001

How to obtain the list of the tables of a base by un script

View 1 Replies View Related

How To Get A List Of Tables Currently In A DB

Mar 21, 2001

Hi all,

Does any one know what command(s) I can use from a SQL prompt to tell me what tables are cruuently residing in a particular database. I'm looking for something along the lines of "select list_of_all_tables from tempdb", which can be applied to any valid db on the system.

Thanks in advance for any guidance.

Rgds,
Kevin

View 3 Replies View Related

List From Three Tables

Oct 5, 2006

HI I have three tables as here:

inventory
isbn, status, status_date, quantity

authors
id, first_name, family_name

books
isbn, category, title, num_pages, price, copyright, author1, author2, author3


How can I list title and author name of the book that is most in stock?

My another problem to

Listing names of authors who have not written ay books

Thanks folks!!!

View 4 Replies View Related

List All Tables Ans SP

May 25, 2008

Hi

can I through a script retrieve a list af all tables and stored procedure in a database?

View 6 Replies View Related

List Tables Which Are Used By A SP

Sep 17, 2007

Hi,
I got a request from a devloper asking, how can he find out what tables his stored procedure his using, so he can remove unwanted SP which are using old tables in the database.

Bharath JrDBA

View 3 Replies View Related

List Of Tables In A Db

Jul 20, 2005

Hi Allcan some one please tell me the transact sql code that can list all tablesin a db.thanksTodd

View 1 Replies View Related

!!help!! How To Save User Inputs From Checkbox List To Database??

Dec 11, 2007

Hi,
 
I'm new to ASP.NET 2.0. I'll like to ask how do one save user input from txtbox, radiobttnlist or checkboxlist into database?
Im implementing a suvrey form here by the way.
 -any reference webs,
-any pointers from experts?
Thank you for your time in reading this email
 
Kayln

View 7 Replies View Related

List Of Stored Procedures With Permission For Executing For User

Jul 26, 2007

I have user XY in SQL 05. I would like to find all stored procedures, where user XY has permission for executing. Is there any way to find it than look in every stored procedure?

Thanks for tips

View 4 Replies View Related

Retrieving A List Ot Tables

Mar 7, 2007

Hello Everyone and thanks for your help in advance.  I am working on an application that connects to SQL Server.  I need to find out if there is any way (I know there is, not sure how) to retrieve a list of tables within a database and also, a way to retrieve a list of databases within a server.  I am using VB.Net in a web application.  Any help on this owuld be greatly appreciated.

View 2 Replies View Related

How To Get List Of Tables In A Database

Jan 22, 2004

Hello

How I get the list of tables in a database. I'm using sql server 2000.

Thanks

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved