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.
I am trying to come up with a solution that does not involve having a version of every stored procedure for every user I have... Here is the problem...
I am going to have multiple users that need to have their own "product table". The structures are going to be the same for all. We currently only have one user and it is a DBO... all stored procedures are dbo.[sp name]... is there any way to get it so that the product table in the SP will be the user owned product table and not the dbo table??
I have tried just taking out the dbo prefix with no luck... the user's default schema will match the table they own so when they do a straight select they get the right information but it is just the SPs that I can't seem to get to work...
The only thing that I have come up with is making the SPs dynamic with having the username as parameter.
I have tried SqlConnection.getSchema("Tables"). it returns me a list of all tables while getSchema("Views") returns me the views in the form of DataTable. But can we have a way to get them together in the same DataTable as a return result? because I want to read the rows by DataTable.CreateDataReader() later.
How would I hide the sa account to be accessible under Logins for a restricted User in sql server 2005 and also other folders like Replication, Managment, etc need to be hidden too.
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
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!
Hello I have a production database that i need to refresh to our test environment daily. The database size is 700 MB. I do not need to transfer the stored procedures and triggers , users and logins. Would a DTS package that runs every night be the best and the easiest solution to implement or should i look into log shipping and snapshot replication.
There is a view in our replicated SQL-2000 database, that returns all user tables and views with replication state (0 if not included into publication, 1 if included):
Code Snippet
CREATE VIEW [dbo].[ViewREPL_PublishedObjects]
AS
SELECT TOP 100 PERCENT
CASE [xtype]
WHEN 'U' THEN 'Table'
WHEN 'V' THEN 'View'
ELSE NULL END AS [Object Type],
[name] AS [Object Name],
CASE WHEN [replinfo] = 0
THEN 0 ELSE 1
END AS [Replicated]
FROM [sysobjects]
WHERE
[xtype] in ('U', 'V')
AND [status] > 0
ORDER BY
(CASE [xtype]
WHEN 'U' THEN 1
WHEN 'V' THEN 2
ELSE 10
END),
[name]
Now we need to upgrade our database to SQL-2005, but [sysobjects] table have been changed, so neither Replicated state could be determined according on [replinfo] column value, nor User/System object according on [status].
So, I need a view with same functionality, that will work under SQL-2005 and 2008.
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.
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.
Hi, What are current thoughts about who should own a Database? I see 3 possibilities: 1. The DOMAINAdministrator (person wo starts up the Server at Bootup) 2. 'sa', or 3. a person/user closely tied to the database.
I'm trying to grant a user group select access to all the views in a database. I already made a query which creates a result set whit the SQL Syntax I (displayed below) need but it seems to be impossible to get this result set executed after creation.
use [AdventureWorksDW2008R2] SELECT 'GRANT SELECT ON [' + SCHEMA_NAME(Schema_id) + '].[' + name + '] TO [DOMAINGROUP]' FROM sys.views;
I'm developing an intranet application and am using the Express versions of VWD and SQL Server 2005 for initial development before obtaining full licensed versions. Database connections work fine when testing from within VWD but when testing from browser, unless the database owner is the IIS servernameASPNET, there are various errors depending on the specific connection settings, i.e. Login failed for user ''. The user is not associated with a trusted SQL Server connection. - Receive this error when a GridView is connected to a remote SSE db. --- SELECT permission denied on object 'Table_1', database 'TEST', schema 'dbo'. Receive this error when GridView is connected to local SSE db not owned by servernameASPNET. --- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. This happens when using any control that is connected to SSE db created in VWD and stored in App_Data folder (owner is the user logon name) --- Any help or ideas would be appreciated. I want to have all local data stored in App_Data folder. Thank you.
In SSMS, I connect Object Explorer to a partially contained database using a contained user login with password. This user has a database role of dbdatareader. When I try to expand the Tables in the database, I get the error:
The SELECT permission was denied on the object 'extended_properties', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)
Is there a way to set permissions for the contained user so that this could be done?
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