Information_schema Permissions
Jul 20, 2005
Hi I need to see all the indexes in a database. The ID has dbo rights
to the database, but not to the master. I can't see anything in
INFORMATION_SCHEMA.CHECK_CONSTRAINTS or
INFORMATION_SCHEMA.KEY_COLUMN_USAGE
An sa ID for the master sees everything however.
Thanks for your help
Pachydermitis
View 5 Replies
ADVERTISEMENT
Mar 28, 2008
Hi to all,
I'm using SQL Server 2005. May I know where the INFORMATION_SCHEMA
is found, can we view this by object explorer.
View 2 Replies
View Related
Feb 24, 2004
Hello,
When the procedure : sp_tables is executed (master db), the table owners are either dbo or INFORMATION_SCHEMA,
any detail about this last ? (to be precise, table_type is view and not table).
Thanks
View 1 Replies
View Related
Oct 18, 2005
Hi:
I need to change a column default to '' and not null for 1500 databases accross 10 servers.
if exists (select * from information_schema.columns
where table_name = 'tblABC'
and column_name = 'columnX'
and data_type = 'VARCHAR'
and is_nullable = 'No'
and column_default = '('')'
)
begin
--do something to implement
end
Here, there is a problem for and column_default = '('')'
I have tried ''''+'('')' + '''' or "'('')'", neither works.
Do you have any idea to deal with the ('') ?
thanks
-D
View 3 Replies
View Related
Feb 13, 2007
I'm having a really hard time displaying the structure of my database using INFORMATION_SCHEMA. Can this be used with Access? I've used it before for sql databases but when I try it with this access one I get an error message telling me: Can't find file c:...INFORMATION_SCHEMA.mdb
I'm hoping maybe there's another command that works just as well or some other way to get around it.
I'm using Visual Web Developer 2005 Express
and my .aspx pages are coded using VB so any insights would be awesome!
Thanks much,
~UNI
View 1 Replies
View Related
Oct 24, 2007
Hi,
I'd like to get information about tables defined in the SqlCe20 database. So I tried to use the following which doesn't work:
string sql = "SELECT COLUMN_NAME AS CN FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ?"cmd = new SqlCeCommand(sql, connection);cmd.Parameters.Add(newSqlCeDataParameter("A", DbTypes.NVarChar);cmd.Prepare();//later in codecmd.Parameters[0].Value = tableName;reader = cmd.ExecuteReader();while (reader.Read())....
Here the reader.Read() returns always false indepent of the table name.
In contrast doing the following without parameter works as expected:
reader = cmd.ExecuteReader(string.Format("SELECT COLUMN_NAME AS CN FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{0}'", tableName));
while (reader.Read())
Because I have to execute this statemen often I have to use prepared statement with parameters.
How can I get it working?
Miroslaw
View 2 Replies
View Related
Dec 26, 2001
Hiya,
I'm trying to run reports, some of which have UserEntered as a criteria. So I'm filling up a list with (SELECT * FROM SysUsers WHERE IsLogin = 1), which is also pulling up INFORMATION_SCHEMA as a login. I'm not really sure why this would be an islogin = 1 or issqluser = 1. Is this a server default login,and if yes,why, and what can I do about it?
Thanks,
Sarah
View 1 Replies
View Related
May 10, 2006
Hi:
from SQL2005 information_schema, I don't see anything related to default constraint.
So, I still need the old way to use old stuff such as
from sysobjects sobj inner join syscolumns scolumn.
I need to check existing 3000 databases to drop any possible default for tableA.columnB's default and then add a new one.
I thought SQL2005 will stop let us to query system table to retrieve table structure info including default, but only via information_schema? :rolleyes:
thanks
David
View 3 Replies
View Related
Nov 26, 2007
Hi there!
I'm trying to find how can I get the information_schema for a temp table.
I'm trying to find all columns of a temp table.
So it will be something like this SELECT * FROM information_schema.columns
But it doesn't work for temp table, I tried tempdb.dbo.information_schema.columns .... nada....
Please help!
Thanks,
Or Tho
View 9 Replies
View Related
Jun 20, 2007
Hi:
I am new to SQLSERVER, so I am trying to learn from all these database views, in Oracle it use 'desc all_tables ' to database dictionary view, can some one tell me how to view SQLserver dictionary view like INFORMATION_SCHEMA.TABLES, or sys.tables?
IF I login as sa, but I only want to view the table list one schema at a time? how do I do that?
I tried :
select table_name from INFORMATION_SCHEMA.TABLES
where table_schema='CIT'....
select table_name from INFORMATION_SCHEMA.TABLES
where table_schema='CIT.DBO'.... give 0 result too.
it give me 0 result, but if I login as CIT, then
'select table_name from INFORMATION_SCHEMA.TABLES' will give 14 tables.
Plus, When I log into Query analyzer, all the tables has dbo. prefix. , why is that?
Thanks a lot
View 3 Replies
View Related
Jul 8, 2003
how do i return only the tables created by the user?
in three of my databases i am inserting one record per 5 secs. in all the tables. how good is using triggers for 'insert instead of' for these tables?
View 5 Replies
View Related
Apr 5, 2006
Hi,
I'm working with MSSQL2K+SP3a, Standard Edition. I defined linked server (MSDE).
On the local server, I can do
select * from [testDB].[INFORMATION_SCHEMA].[TABLES] -- local
select * from [testSRV].[testDB_far].[dbo].[sysobjects] -- linked
but not
select * from [testSRV].[testDB_far].[INFORMATION_SCHEMA].[TABLES]
How can I access the INFORMATION_SCHEMA on the linked server ?
Thanks,
Helena
View 3 Replies
View Related
Nov 30, 2007
The following code example to returns table space usage in my databases, except for AdventureWorks.
When I "USE AdventureWorks", I get the following message. "Invalid object name 'INFORMATION_SCHEMA.tables'."
Why is AdventureWorks different? Thanks. Bill
USE AdventureWorks
-- Declare variables
DECLARE @AWTables TABLE (SchemaTable varchar(100))
DECLARE @TableName varchar(100)
--Insert Table names into the TABLE variable
INSERT @AWTables
(SchemaTable)
SELECT TABLE_SCHEMA + '.' + TABLE_NAME
FROM INFORMATION_SCHEMA.tables
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_SCHEMA + '.' + TABLE_NAME
-- Report on each table using sp_spaceused
WHILE (SELECT COUNT(*) FROM @AWTables) > 0
BEGIN
SELECT TOP 1 @TableName = SchemaTable
FROM @AWTables
ORDER BY SchemaTable
EXEC sp_spaceused @TableName
DELETE @AWTables
WHERE SchemaTable = @TableName
END
View 4 Replies
View Related
Oct 12, 2006
Hi,
I have a "master" table that holds the names of data tables (one record in the "master" table for each "data" table).
Can I create a ForeignKey constraint that will prevent the "master" table records from being removed if the cooresponding "data" table exists? Is the way to do this to use INFORMATION_SCHEMA.TABLES as the PrimaryKeyTable for the ForeignKey?
Thanks!
View 1 Replies
View Related
Jul 20, 2005
Hi Folks:I'm a little new to SQLServer, so please pardon my ignorance!I've found the INFORMATION_SCHEMA views for TABLES, COLUMNS, andTABLE_CONSTRAINTS. I'm looking for the views that will give me the list ofcolumns by constraint.For instance, if Table1 has a unique key called Table1_UK01, I can find thatunder INFORMATION_SCHEMA.TABLE_CONSTRAINTS. But I also need to know thecolumns in that UK constraint. I've triedINFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE andINFORMATION_SCHEMA.KEY_COLUMN_USAGE, but the UK I have defined for this usertable doesn't seem to show up in either of those views.Can anyone point me in the right direction? Any sample queries would betremendously appreciated. I'm going to be using this meta-data toautomatically generate quite a bundle of stored procs that do updates basedon finding rows via unique keys...TIA,Dave
View 3 Replies
View Related
Oct 23, 2007
Hi
I'm building a data warehouse - my end users connect using Access via ODBC Microsoft SQL Server driver (2000.85.1117.00).
However, whenever they connect using Access via ODBC they get a huge list of sys and INFORMATION_SCHEMA views, in addition to the data warehouse tables they need to access.
How can I remove these sys and INFORMATION_SCHEMA views from the list of tables/views presented to the end user?
I've tried denying access by changing permissions to deny in the public role of the master database - I have also changed permissions in the public role in the data warehouse database. When I do this, the ODBC connection fails to retrieve any objects because it doesn't have access to sys.databases (and various other unspecified objects).
I'm stuck - help!
View 4 Replies
View Related
Oct 14, 2007
We have a legacy app where some of our web page urls were hardcoded into the stored procs (SQL 2000 SP4 database). We have changed the system and so changed the hardcoded strings with a value stored in a config table. We used the following query to identify the hardcoded urls (say LegacyPage.asp) €“
select routine_name
from information_schema.routines
where routine_definition like '%LegacyPage.asp?%'
However, even after this we keep getting issues with LegacyPage.asp being referenced. Tracing the code, I found that there is at least one SP (say spHardCoded) which does not turn up in the query, but does have the string LegacyPage.asp? in the routine definition. When I run the following query €“
select routine_name
from information_schema.routines
where
routine_name = 'spHardCoded'
and routine_definition like '%LegacyPage.asp?%'
0 rows are returned!
Am I missing something obvious here or is INFORMATION_SCHEMA.Routines metadata not always updated? Is there any way to force the metadata to be updated, before we query it? Is there a better system catalog view which lets me do the same thing? Any help would be really appreciated.
View 3 Replies
View Related
Apr 25, 2008
Hi,
we've just installed SQL2005 and, as expected, are hitting problems with collation settings.
We have made sure that the collation of our new server is the same as the old (working) SQL2000 server (both are Latin1_General_CI_AS) but a function that works fine on the 2000 box just doesn't work on the 2005 box.
The problem is this...
Code Snippet
select *
from information_schema.[tables] as t
left join :: fn_ListExtendedProperty('MS_Description','user','dbo','table',null,null,null) as xp on ( xp.objname = t.table_name )
...where that string comparison on "table_name" results in...
"Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "Latin1_General_CI_AI" in the equal to operation."
Now... I can't see where the "Latin1_General_CI_AI" is coming from. The two data sources are both "system" sources, so should, I would have thought, been the same. If I do...
execute sp_help "information_schema.tables"
...all the columns are Latin1_General_CI_AS. If I do...
execute sp_help fn_ListExtendedProperty
...the same collation is returned for all columns.
I've checked everything I can think of (server, master, tempdb, etc.), and everything seems to be "AS".
Where might this "AI" collation be defined ? We have only just installed 2005, so a re-install, while a pain, is not a massive problem, but what should we check/change ?
Thanks
View 1 Replies
View Related
Jul 20, 2005
I ran the following query in Query Analyzer for a 7 column table.SELECT c.name,c.colid FROM syscolumns c WHERE c.id=925962375 ORDER BYc.colidThe results were:I_CSD 1X_STE_XML2I_USR_LCK4T_CRT_RCD5I_USR_CRT_RCD6T_UDT_RCD7I_USR_UDT_RCD8If I use the information_schema view (SELECT column_name,ordinal_position FROM information_schema.columns WHERE table_name ='CSD_XML') I get the same results.The problem is that the colids go from 2 to 4 and the colids gothrough 8 when there are only 7 columns.At one time there was another column in the table, but it has sincebeen dropped and isn't there anymore. It seems that the colids insyscolumns did not update when the column was dropped.Is this because of the way I dropped the column? Is there anything Ican do now that it has happened?
View 3 Replies
View Related
Aug 2, 2006
Using SQL Server 2k5 sp1, Is there a way to deny users access to a specific column in a table and deny that same column to all stored procedures and views that use that column? I have a password field in a database in which I do not want anyone to have select permissions on (except one user). I denied access in the table itself, however the views still allow for the user to select that password. I know I can go through and set this on a view by view basis, but I am looking for something a little more global.
View 5 Replies
View Related
Apr 11, 2007
I am working http location and using sql server 2005 ,it is showing an error as " DELETE permission denied on object 'CourseDetails', database 'LOGIN', schema 'dbo'." CourseDetails is my table name and LOGIN is my database name.
View 2 Replies
View Related
Feb 26, 2002
I am trying to setup a BCP command in a stored procedure it workds for me an administrator. i'm using a user's account in the username and password in the BCP command of a user that has DBO rights on the database i'm extracting the dat from. I can execute the stored procedure from my workstation and the server using my login account in QA. Using the username of the dbo account in QA i can get it to work at the server but not at my workstation orher workstation. my thoughts were that it was network permission related but i bumped her account to that of a domain admin and it still will only work on the server. it generates the following error.
The name specified is not recognized as an
internal or external command, operable program or batch file.
this is what i'm executing with the names changed to protect the innocent
EXEC MASTER..XP_CMDSHELL 'bcp file_test..table_out out C:filej.txt -U username -P password -c'
the environment is SQL7 on a 2000 Advanced server and we are running active directory.
i'm guessing it's something i'm just overlooking. i hope.
any help would be most appreciated.
View 1 Replies
View Related
Jul 17, 2002
Hi!
I have a user who needs only access SQL Server to see jobs in the job folder.
What permissions should be granted to this user?
Nora
View 2 Replies
View Related
May 11, 2000
Hi ,
MY sysadministrator gave a sysadmin permissions to my login..,but i am not getting those permissions... when i check syspermissions system table it is showing my login id is having sysadming permissions...
when we checked his machine , in
security
serverroles
sysadministrators---properties--there it is showing my login-id..
but when i trying to click properties of servers it showing
'' ONLY MEMBERS OF THS SYSADMIN CAN ACCESS THIS FEATURE''''
why it is happening pls let me know..
thank u
kavira
View 3 Replies
View Related
Jun 22, 2000
When I restore a database, I lose login permission and role permissions. I end up going
into the login and unselect and reselect the database to make sure that the login works
with the database. Is there a way to get around this??
One other question:: I have added 65 new tables to a database and want to give select
only to all logins to those specific table -- is there an easy way of doing this???
View 1 Replies
View Related
May 16, 2000
WHat kind of permissions do you need to create a new job?
It looks like I am the only one that can since I have full administator rights. So I created the job and then changed ownership to another user,
but he cannot add a new step. WHen he tried to created a job he received message
ERROR 229 EXECUTE permission denied on object 'sp_enum-Sqlagent_subsystem'
database 'MSDB' owner DBO
I gave the user access to MSDB as DBO but it didn't make any difference.
View 1 Replies
View Related
May 17, 2000
Can anyone help me with this problem?
Is it possible for a user that runs one application against database A to update a table via a stored procedure i database B during runtime without beeing entered as a user in that database, i.e execute that stored procedure with a default or given user.
The reason is that we don't want to administrate an unknown number of users that will have no access to that database except via that stored procedure.
Thanks/E
View 1 Replies
View Related
Mar 9, 2001
what does it meant if I go and look at the permissions on a user and in one item (say a stored procedure) there is a green check giving permissions but the check cannot be removed. How can I remove that?
View 1 Replies
View Related
Nov 1, 2004
What are the minimum permissions required to be able to read the application log in the event viewer &
run perfformance monitor? Do you have to have NT admin rights on the server?
thanks!
View 2 Replies
View Related
Jun 17, 1999
To all,
I need some help understanding some things about SQL permissions. Login ID A is a login mapped to the dbo of database A and B. Login ID B is aliased to dbo. Why when running a transfer from database A to B, it runs OK when run by Login A, but fails as Login B. In the failure situation, I get error 15244, only sa or dbo can set database permissions. I thought by virtue of the aliasing I had dbo permissions.
This SQL stuff is more confusing than any TCP/IP or Cisco stuff I have ever done.
Thanks in advance,
Ed
View 2 Replies
View Related
Apr 1, 1999
Good Morning,
I have a problem with SQL Server permissions.
My Database has +/- 70 tables. A user has select permissions to +/- 10.
But I found a table where he has update permission to one table.
I tried to revoke this several times and I couldn´t revoke it.
What I have to do?
View 1 Replies
View Related
Jun 24, 2002
My SQLAdmins are asking for the following:
1) Administrator access to the local box on running SQL
2) The ability to access the SQLData directory directly through drive mappings
We are attempting to create as secure an environment as possible and keep everything locked down. In my opinion, they do not need these type of accesses. They do have sa priviliges to the SQL server but I see no reason to give them Windows 2000 administrator priviliges. Also, to further the security on the servers (they are publicly accessible), we are trying to eliminate all shares including admin shares. Seems to me they should be able to accomplish everything using the SQL tools. Am I off base on this?
View 2 Replies
View Related
Dec 7, 1998
Is there a "SP_" stored procedure that will report what permissions a group and or user has?
View 1 Replies
View Related