Find The List Of Tables For A User?
Feb 18, 2015how 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 Replieshow 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 RepliesHow 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 RelatedThe views are in XYZ production database and user needs the list of indexes on the tables on which the views has been created.
query to find list of indexes on the tables on which the views has been created.
How to find the list of queries currently running in the Database with User Login Information.
Since my database application is running slow, to find the slow queries.
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
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 Relatedhow 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 RelatedI would like to know if there is a way to find out who changed a users roles/access WITHOUT using the audit function. For example, if a user account was created and given SA access then changed to read only, how can I find out who made that change? I tried searching for an answer, but kept getting no results. I'm thinking this may tie into the sys.sysusers view?
View 3 Replies View Related
Hello,
I am trying to migrate reporting services from SQL server 2000 to SQL 2005. I followed the migration steps listed in one of the TechNet documents. Installed SQL 2005 and SP2.
Backed up existing SQL 2000 databases and restored on SQL 2005.
Went to Configuration tool and then to the Database setup. Connected to SQL 2005.
Clicked on the Upgrade button. The upgrade fails and I always get the following errors:
"The database version (C.0.6.54) does not match your reporting services installation. You must upgrade your Reporting services database"
Then I get this exception:
System.Data.SqlClient.SqlException: Cannot find the user 'RSExecRole', because it does not exist or you do not have permission.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ReportingServices.Common.DBUtils.ApplyScript(String connectionString, String script)
at ReportServicesConfigUI.SqlClientTools.SqlTools.ApplyScript(String connectionString, String script)
I do not understand why it is looking for user 'RSExecRole', which is a role.
Appreciate your help
I tried all the INFORMATION_SCHEMA on SQL 2000 andI see that the system tables hold pretty much everything I aminterested in: Objects names (columns, functions, stored procedures, ...)stored procedure statements in syscomments table.My questions are:If you script your whole database everything you end up havingin the text sql scripts, are those also located in the system tables?That means i could simply read those system tables to get any informationI would normally look in the sql script files?Can i quickly generate a SQL statement of all the indexes on my database?I read many places that Microsoftsays not to modify anything in those tables and not query them since theirstructure might change in future SQL versions.Is it safe to use and rely the system tables?I basically want to do at least fetching of information i want from thesystem tables rather than the SQL script files.I also want to know if it's pretty safe for me to make changes in thesetables.Can i rename an object name for example an Index name, a Stored Procedurename?Can i add a new column in the syscolumns table for a user table?Thank you
View 4 Replies View Related
Hi,
Please give the T-SQL script for this ? Thanks
Shanth
Also , is it true that Grants to service accounts should go through roles as it is against audit & compliance standards? If yes, than how to find out the list of users who has direct grant to a service account ?
- Then how to revoke this grant from service account and than how to grant through the role ?
- Is there a script that i can run and find the list of users in each SQL server instance ?
Hi all,
I want to find the list of filenames associated with the SQL server instance programmatically. As VDI is concerned with taking backup of SQL server. Can we find the list of filenames associated with a DB using VDI ? or Is there any other way to know filenames?
Thanks in Advance,
Ram
I have a one problem in my sql server. I would like to find out the list of all Monday's dates in the year 2006. Can anybody help me out?.
View 14 Replies View RelatedI'm using this to find duplicates where a person has the same email but varying firstname and lastnames:
select distinct t1.booking_id, t1.first_name, t1.last_name, t1.email_add, t1.booking_status_id
from [aren1002].[BOOKING]
as t1 inner join [aren1002].[BOOKING]
as t2
on t1.last_name=t2.last_name and t1.booking_id<>t2.booking_id
where t1.booking_status_id = 330
order by last_name asc
Sample data:
3927 Greg Smith greg@emailno1.com 303
5012 John Smith greg@emailno1.com 303
6233 John Smith greg@emailno1.com 303
4880 Dulcie Abuud dulcie@theiremail.com 303
However it is listing the non duplicate rows, For example: The record with Abuud as the last name, doesn't have any duplicates in the table, so I don't want it listed.
The data should be like this:
3927 Greg Smith greg@emailno1.com 303
5012 John Smith greg@emailno1.com 303
6233 John Smith greg@emailno1.com 303
Hi,
I am trying to use the SQL "Contains" method and full text indexing for some search functionality in an application.
I understand that full text indexes will break data using certain word breakers which are dependent on which language the index is created with. However, I cannot seem to find a list of the what the actual word breakers are. I cannot find these online or in Books Online ... please can you let me know where I can find out more about this?
Many Thanks
Hi,
I was wondering if there was a SQL query I could run that would list all the current jobs in a SQL 2005 database? I would like to check to ensure a job exists before I call it, but was having trouble finding a way to determine if it existed.
Thanks for any advice!
-Flea#
I have installed the SharePoint adapters from codeplex and they show OK in SSIS 2008R2. But in SSIS 2012, I can't find them and their is no SSIS component tab to pick it and add it to the toolbox.
View 2 Replies View RelatedGot following query:
SELECT
event_data.value('(event/data/value)[4]', 'bigint') AS cpu_time,
--database name
event_data.value('(event/data/value)[5]', 'bigint') AS duration,
--estimated cost
--estimated rows
--nest level
[code]...
Basically, is a simple T-SQL query that reads the local file for my already setup extended event sessions. But I can't find the way to retrieve the following attributes as part as the T-SQL query:
--database name
--estimated cost
--estimated rows
--nest level
--object name
I am trying to find a BOL or some MS link with the full list of possible values for event_data.value but can't find one.
Is there anyway,can we find the list of servers by querying at active directory?
View 3 Replies View RelatedNeed a script to capture current date modify table list(12 AM to 11:59 PM PST) in a database.
View 7 Replies View RelatedWe have more that 500 crystal reports and we would like to find out list of stored procedure used by crystal reports. Can we find out ?
View 4 Replies View RelatedI 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 RelatedRecently 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
Hi, Does anyone has a script to get user permissions on all tables?
Thanks
Is their any sql to find the list of sp created by user's in master db?
View 9 Replies View Related
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
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
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
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 RelatedAny way to list all databases that a user has access to?
View 6 Replies View RelatedI 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
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