Showing posts with label generate. Show all posts
Showing posts with label generate. Show all posts

Monday, March 12, 2012

List Property - can grow/can shrink

I'm trying to generate a report that will simulate Avery Standard form 5388 - a basic 3 x 5 index card.

I'm using a list and a table to generate the output. Basically I have the list sized at exactly 3 x 5. I'm limiting my rows to be returned to 5 rows so that the table does not grow too large, and I'm using the Page Header to handle the top space, and have placed the list/table regions within the body region to handle the left margin.

The problem I'm having is to have the list print exactly 3x5...I would like to make sure that the list ALWAYS maintains this size - no growing or shrinking;however the list does not have this property that I can see.

I'm currently working in RS2000...can it be done in either 2000 or is this something that 2005 can only handle.

I figured it out...I placed a 3x5 rectangle inside the 3x5 list data region. Seems to be working.

List of users + roles + rights

How can I generate a list/view of all users/groups with appropriate roles and rigths?SP_HELPROTECT list all the information in the database.|||Hi,
Can someone please let me know if there is some way to find out the roles of a user in SQL server 2000?
The sysusers table has a column called roles that stores a bit set for every role associated with the user. But given a user name / uid how to find out all the roles (role ids will do) associated with that user?
Please help ... its urgent.
Thanks for your time,
Sayali|||In SQL-2000, this is stored in sysmembers (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sys-m_6f3n.asp).

-PatP

Friday, March 9, 2012

List of primary keys

Hi
Does anyone know how to generate a list of tables' primary keys, for all tables in a database? Is there a stored procedure or similar
Thanks
Mattuse database
select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
Ana
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt|||Matt,
use pubs
go
select tc.TABLE_NAME, kcu.COLUMN_NAME, kcu.ORDINAL_POSITION
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS as tc
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE as kcu
on (tc.TABLE_SCHEMA = kcu.TABLE_SCHEMA and
tc.TABLE_NAME = kcu.TABLE_NAME and
tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME)
where tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
order by tc.TABLE_NAME, kcu.ORDINAL_POSITION
Chief Tenaya
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt|||Hi,
Execute the query from the database you require the primary key details;
select * from information_schema.table_constraints where
constraint_type='Primary Key'
Thanks
Hari
MCDBA
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt

List of primary keys

Hi,
Does anyone know how to generate a list of tables' primary keys, for all tables in a database? Is there a stored procedure or similar?
Thanks,
Matt
use database
select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
Ana
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt
|||Matt,
use pubs
go
select tc.TABLE_NAME, kcu.COLUMN_NAME, kcu.ORDINAL_POSITION
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS as tc
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE as kcu
on (tc.TABLE_SCHEMA = kcu.TABLE_SCHEMA and
tc.TABLE_NAME = kcu.TABLE_NAME and
tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME)
where tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
order by tc.TABLE_NAME, kcu.ORDINAL_POSITION
Chief Tenaya
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt
|||Hi,
Execute the query from the database you require the primary key details;
select * from information_schema.table_constraints where
constraint_type='Primary Key'
Thanks
Hari
MCDBA
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt
|||Thanks for all your speedy responses!
Matt
http://www.matthewbarr.co.uk/

List of primary keys

Hi,
Does anyone know how to generate a list of tables' primary keys, for all tab
les in a database? Is there a stored procedure or similar?
Thanks,
Mattuse database
select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
Ana
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt|||Matt,
use pubs
go
select tc.TABLE_NAME, kcu.COLUMN_NAME, kcu.ORDINAL_POSITION
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS as tc
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE as kcu
on (tc.TABLE_SCHEMA = kcu.TABLE_SCHEMA and
tc.TABLE_NAME = kcu.TABLE_NAME and
tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME)
where tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
order by tc.TABLE_NAME, kcu.ORDINAL_POSITION
Chief Tenaya
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt|||Hi,
Execute the query from the database you require the primary key details;
select * from information_schema.table_constraints where
constraint_type='Primary Key'
Thanks
Hari
MCDBA
"Matt" <m.barr@.rsamd.ac.uk> wrote in message
news:7F785B2D-D9D3-4848-B336-8789264BABEB@.microsoft.com...
> Hi,
> Does anyone know how to generate a list of tables' primary keys, for all
tables in a database? Is there a stored procedure or similar?
> Thanks,
> Matt|||Thanks for all your speedy responses!
Matt
http://www.matthewbarr.co.uk/

Monday, February 20, 2012

List All Instances of SQL Server

Hi all,
I am trying to generate a list of all available SQL Servers (named instances
and all) on a network. I have seen over and over again to use SQLDMO or isq
l
-L.
The problem that I am having is that these methods only seem to want to
return one instance from each computer.
ex. Computer "Main" has
Main
Main\Instance1
Main\Instance2
These methods are only returning "Main" in the list and not the rest of the
named instances. I have tried everything I can think of, including making
sure the protocols "named pipes" and "TCP/IP" are activated for each
instance. No matter what I have tried these Names won't return. I have
resorted to reading the registry to get get the instances for the local
computer from the "InstalledInstances" key.
This method is fine for the local computer but won't work for network
computers.
Do any of you have any suggestions for returning a complete list of all
available servers?
Is there something I'm doing wrong or missing?
Also I would like to return a list of local servers when the network cable
is unplugged. Do you have a suggestion for how to solve this problem?
Thanks for any help,
KenKen,
I was trying to do the same thing. Only thing I found that returned my
Instances was the following.
Only thing is not sure how well this will work in a network environment
since this is reading the registry. If you figure how to do it on a network
or a different way let me know your solution.
RegistryKey objInstances = Registry.LocalMachine;
objInstances = objInstances.OpenSubKey(@."SOFTWARE\Microsoft\Microsoft SQL
Server\Instance Names\SQL", true);
foreach (string Keyname in objInstances.GetValueNames())
{
tvTableInfo.Nodes.Add(Keyname);
}
"Ken" <Ken@.discussions.microsoft.com> wrote in message
news:E4BE412C-A98C-4522-B902-5AC1398F2F72@.microsoft.com...
> Hi all,
> I am trying to generate a list of all available SQL Servers (named
> instances
> and all) on a network. I have seen over and over again to use SQLDMO or
> isql
> -L.
> The problem that I am having is that these methods only seem to want to
> return one instance from each computer.
> ex. Computer "Main" has
> Main
> Main\Instance1
> Main\Instance2
> These methods are only returning "Main" in the list and not the rest of
> the
> named instances. I have tried everything I can think of, including making
> sure the protocols "named pipes" and "TCP/IP" are activated for each
> instance. No matter what I have tried these Names won't return. I have
> resorted to reading the registry to get get the instances for the local
> computer from the "InstalledInstances" key.
> This method is fine for the local computer but won't work for network
> computers.
> Do any of you have any suggestions for returning a complete list of all
> available servers?
> Is there something I'm doing wrong or missing?
> Also I would like to return a list of local servers when the network cable
> is unplugged. Do you have a suggestion for how to solve this problem?
> Thanks for any help,
> Ken|||Thanks, but that is essentially what I accomplished by reading the
"NamedInstances" key. That type of situation works well for the local
computer but like you said, it won't work for network machines.
Thanks for the input though.
"JP" wrote:

> Ken,
> I was trying to do the same thing. Only thing I found that returned my
> Instances was the following.
> Only thing is not sure how well this will work in a network environment
> since this is reading the registry. If you figure how to do it on a networ
k
> or a different way let me know your solution.
> RegistryKey objInstances = Registry.LocalMachine;
> objInstances = objInstances.OpenSubKey(@."SOFTWARE\Microsoft\Microsoft SQL
> Server\Instance Names\SQL", true);
> foreach (string Keyname in objInstances.GetValueNames())
> {
> tvTableInfo.Nodes.Add(Keyname);
> }
>
>
> "Ken" <Ken@.discussions.microsoft.com> wrote in message
> news:E4BE412C-A98C-4522-B902-5AC1398F2F72@.microsoft.com...
>
>|||I am using sql-dmo to get list of instances. I have the same problem. But
i figured out that when i disable my local firewall application sql-dmo
returns all SQL Server instances. So try to temporarily turn off your
firewalls.
On Fri, 19 Aug 2005 02:22:04 +0300, Ken <Ken@.discussions.microsoft.com>
wrote:

> Hi all,
> I am trying to generate a list of all available SQL Servers (named
> instances
> and all) on a network. I have seen over and over again to use SQLDMO or
> isql
> -L.
> The problem that I am having is that these methods only seem to want to
> return one instance from each computer.
> ex. Computer "Main" has
> Main
> Main\Instance1
> Main\Instance2
> These methods are only returning "Main" in the list and not the rest of
> the
> named instances. I have tried everything I can think of, including
> making
> sure the protocols "named pipes" and "TCP/IP" are activated for each
> instance. No matter what I have tried these Names won't return. I have
> resorted to reading the registry to get get the instances for the local
> computer from the "InstalledInstances" key.
> This method is fine for the local computer but won't work for network
> computers.
> Do any of you have any suggestions for returning a complete list of all
> available servers?
> Is there something I'm doing wrong or missing?
> Also I would like to return a list of local servers when the network
> cable
> is unplugged. Do you have a suggestion for how to solve this problem?
> Thanks for any help,
> Ken|||That was it.
I was using a software firewall and had disabled that to see if it was the
problem, and I had assumed that the windows firewall was disabled(as I had
previously disabled it). Once I disabled the windows firewall all instances
started showing up.
Thanks for the response,
Ken
"Igor Solodovnikov" wrote:

> I am using sql-dmo to get list of instances. I have the same problem. But
> i figured out that when i disable my local firewall application sql-dmo
> returns all SQL Server instances. So try to temporarily turn off your
> firewalls.
> On Fri, 19 Aug 2005 02:22:04 +0300, Ken <Ken@.discussions.microsoft.com>
> wrote:
>
>