Questions tagged [sysobjects]

31 questions
70
votes
8 answers

The SELECT permission was denied on the object 'sysobjects', database 'mssqlsystemresource', schema 'sys'

SETUP: SQL Server 2005 & DotNetNuke 05.01.02. This started with me trying to install a DNN Module that had "select * from dbo.sysobjects" in it's SQL scripts. That failed with the following error: The SELECT permission was denied on the object…
Chris Holmes
  • 11,444
  • 12
  • 50
  • 64
23
votes
6 answers

Listing all indexes

I'm wondering what the simplest way to list all indexes for all tables in a database is. Should I call sp_helpindex for each table and store the results in a temp table, or is there an easier way? Can anyone explain why constraints are stored in…
l15a
  • 2,547
  • 5
  • 29
  • 41
8
votes
2 answers

What is syncobj in SQL Server

When I run this script to search particular text in sys.columns and I get a lot of "dbo.syncobj_0x3934443438443332" like rows. SELECT c.name, s.name + '.' + o.name FROM sys.columns c INNER JOIN sys.objects o ON c.object_id=o.object_id INNER JOIN…
hgulyan
  • 8,099
  • 8
  • 50
  • 75
7
votes
1 answer

Create a foreign key to system tables

I want to create table with to columns: IdRole IdProcedure the idea is that IdProcedure is a FK to sys.objects. When I create this query: SELECT * FROM sys.objects WHERE type='p' it works fine, but this one: ALTER TABLE…
davibq
  • 1,089
  • 11
  • 31
5
votes
3 answers

In SQL Server 2000, is there a sysobjects query that will retrieve user views and not system views?

Assuming such a query exists, I would greatly appreciate the help. I'm trying to develop a permissions script that will grant "select" and "references" permissions on the user tables and views in a database. My hope is that executing the "grant"…
Scott Lawrence
  • 6,993
  • 12
  • 46
  • 64
3
votes
2 answers

interrogating table lock schemes in T-SQL

Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out.
ninesided
  • 23,085
  • 14
  • 83
  • 107
3
votes
2 answers

retrieving the name of a user created table type programatically

Running a select on sys.objects for a type I created: CREATE TYPE [dbo].[IntListType] AS TABLE( [ID] [int] NULL) Select * From sysObjects Where Name Like '%listtype%' I get the names back as follows: name : TT_IntListType_2E4CAB33 xtype :…
Bas Hamer
  • 33
  • 2
2
votes
3 answers

How can I spot in what database is a stored procedure with name 'myStoredProcedure'?

There are bunch of databases to the SQL server I am connected. How should I query the sysobjects in order to spot in what database a stored procedure with name 'myStoredProcedure' is located ? The query should return the database name. Thanks
pencilCake
  • 51,323
  • 85
  • 226
  • 363
2
votes
1 answer

Discover primary / unique keys in Sybase ASE

In Sybase ASE, I would like to discover all primary and unique keys. I want to do something similar to what is explained in this answer: Identifying Sybase tables, fields, keys, constraints But unfortunately, this doesn't work for me. Somehow the…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
2
votes
1 answer

Identifying Sybase tables, fields, keys, constraints

I'm trying to set up a Sybase query that will give me the following output: Table KeyType KeyNumber Column table1 PK 1 table1_id table1 FK 2 table2_id table1 FK 3 …
Karl
  • 5,573
  • 8
  • 50
  • 73
2
votes
1 answer

Sybase ASE 15.7 - How can I merge objects from two databases into one single database?

I have an application which uses Sybase ASE 15.7 for the underlying database. In older days it was recommended to split the tables and located them in two different databases let's say db1 and db2. I know that there are no naming conflicts which…
2
votes
2 answers

Need to identify a table in all objects in database

I need to identify a table that is mentioned anywhere in database (in stored proc, views, and, etc.). I tried to find a query online, but couldn't find it. Any help would be great!
NonProgrammer
  • 1,337
  • 2
  • 23
  • 53
2
votes
2 answers

How to get Column value without knowing column name ? SQL Server

I have table name as @Table_Name I have column value as @Value but don't have the column name (but that exist at 1st position and can be Seek_id or prov_id ...I have to compare my value with this id ) How can I compare that table column name value…
KPSingh
  • 489
  • 1
  • 3
  • 7
1
vote
1 answer

Getting Table Information

I am trying to get the table information give a table name so I wrote a query like this: SELECT so.name, sc.name, st.name, sc.length, CASE WHEN sc.status = 0x80 THEN 'Y' ELSE 'N' END AS IsIdent, ColOrder FROM Asdim.dbo.sysobjects so INNER…
peter
  • 2,396
  • 6
  • 24
  • 29
1
vote
1 answer

Getting column names from a table

I am trying to get column names for a Given table. So I wrote a query like this: SELECT sc.Name FROM Asdim.dbo.sysobjects so INNER JOIN Asdim.dbo.syscolumns sc ON so.id = sc.id INNER JOIN Asdim.dbo.systypes st ON…
peter
  • 2,396
  • 6
  • 24
  • 29
1
2 3