Showing posts with label views. Show all posts
Showing posts with label views. Show all posts

Friday, March 30, 2012

print list of queries, tables, views and sp

I just started a new job and 1st time on sql server, how can i print list of queries, tables, views, stored procedures and functions?What do you mean by print?
What version of SQL Server are you running? This will have an effect on the query you need to run. The below example was written for 2000

SELECT name
, id
, type
FROM sysobjects
WHERE type IN ('V', 'U', 'SP', 'FN')
-- v = view, u = table, sp = sproc, fn = user-defined function|||2005 Users Note:
BOL Says
Important: This Microsoft SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use catalog views instead.

Any general comments as to whether we should still be coding with sysobjects ?

:angel:

GW|||We are kind of caught on the edge of the sword on this issue. Because users rarely give us enough information to know what version of SQL they are using, we tend to give them the answers that work under the largest possible set of conditions.

You are correct, using the catalog views is preferable if you are running a version of SQL Server that supports the catalog views. On a "going forward" basis, you probably ought to only use the catalog views, but on a "forum answer" I tend to stick with what will work for the largest number of people.

-PatP|||Anybody have the catalog solution to hand?

I don't get to play on much 2K5, but I am going to be taking my MCTS in it in a couple of months, so I should really get brushed up on it :p|||Play around with the view sys.objects. You should have it in no time. I think id changed to object_id, but most of the rest is the same.|||SELECT ROUTINE_TYPE, ROUTINE_SCHEMA, ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES

SELECT TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES-PatP

Wednesday, March 21, 2012

Primary key in views.(SQL Server 2005)

Hello,

When I use MSSQL Server 2000, primary key in views(The primary key of base table) detected by sql server 2000.
But, new version (2005) do not this, that mean when I "Modify" a view in Enterprise Manager, there is not any Identity filed in list and I have some problem in my programming.
Please help me.Not sure I understand the request. What are you trying to modify. You can always use query editor to create/alter/modify a view's definition.

Can you elaborate more.

Saturday, February 25, 2012

Preview Problem!

I've set the pagesize to 11in, 8.5in and the body width to 10.5 to compensate
for the margins. the preview views in landscape but when i try to export to
pdf i get an "index out of range error." If I change the pagesize to 11in,
15in it works ok unless i drill down before the export, then i get the same
error again.Could you send me your RDL and preview cache file ( its name is
<reportname>.rdl.data) for investigation?
Thank you
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"VC" <VC@.discussions.microsoft.com> wrote in message
news:79011CE7-9208-4EF7-9F80-A793393F0A6D@.microsoft.com...
> I've set the pagesize to 11in, 8.5in and the body width to 10.5 to
> compensate
> for the margins. the preview views in landscape but when i try to export
> to
> pdf i get an "index out of range error." If I change the pagesize to
> 11in,
> 15in it works ok unless i drill down before the export, then i get the
> same
> error again.|||It did not happen on SP1.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"VC" <VC@.discussions.microsoft.com> wrote in message
news:10DD33E1-3EDD-46B3-97E0-B58024702F12@.microsoft.com...
> Yes, that would be great. How do i send them to you?
> "Lev Semenets [MSFT]" wrote:
>> Could you send me your RDL and preview cache file ( its name is
>> <reportname>.rdl.data) for investigation?
>> Thank you
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "VC" <VC@.discussions.microsoft.com> wrote in message
>> news:79011CE7-9208-4EF7-9F80-A793393F0A6D@.microsoft.com...
>> > I've set the pagesize to 11in, 8.5in and the body width to 10.5 to
>> > compensate
>> > for the margins. the preview views in landscape but when i try to
>> > export
>> > to
>> > pdf i get an "index out of range error." If I change the pagesize to
>> > 11in,
>> > 15in it works ok unless i drill down before the export, then i get the
>> > same
>> > error again.
>>