i want to get all users database name
but sp_helpdb return all database,and
ms advice don't use system table ,how can i do this?
thank youDid u mean, to get all the users in the database. Then use,
sp_helplogins
Thanks
Hari
MCDBA
"frank" <anonymous@.discussions.microsoft.com> wrote in message
news:cab701c3ba43$10011f30$a601280a@.phx.gbl...
> i want to get all users database name
> but sp_helpdb return all database,and
> ms advice don't use system table ,how can i do this?
> thank you|||It's okay to just query it. Updating it is really something you don't want
to do.
btw, you could also use:
select catalog_name [Name of the database where the current user has
permissions.]
from information_schema.schemata
where catalog_name not in
('master','msdb','tempdb','model','northwind','pubs')
--
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net
"frank" <anonymous@.discussions.microsoft.com> wrote in message
news:cab701c3ba43$10011f30$a601280a@.phx.gbl...
> i want to get all users database name
> but sp_helpdb return all database,and
> ms advice don't use system table ,how can i do this?
> thank you|||thanks a lot oj,it's so helpful
>--Original Message--
>It's okay to just query it. Updating it is really
something you don't want
>to do.
>btw, you could also use:
>select catalog_name [Name of the database where the
current user has
>permissions.]
>from information_schema.schemata
>where catalog_name not in
>('master','msdb','tempdb','model','northwind','pubs')
>--
>-oj
>RAC v2.2 & QALite!
>http://www.rac4sql.net
>
>"frank" <anonymous@.discussions.microsoft.com> wrote in
message
>news:cab701c3ba43$10011f30$a601280a@.phx.gbl...
>> i want to get all users database name
>> but sp_helpdb return all database,and
>> ms advice don't use system table ,how can i do this?
>> thank you
>
>.
>
Showing posts with label advice. Show all posts
Showing posts with label advice. Show all posts
Monday, March 19, 2012
Wednesday, March 7, 2012
how 2 insert the value from a SP into a tmp table
can any one advice me on how to insert the results of a SP into a temp
table
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!INSERT INTO #tmp (col1, col2, ...)
EXEC procname
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u%23myVz9HFHA.3332@.TK2MSFTNGP14.phx.gbl...
>
> can any one advice me on how to insert the results of a SP into a temp
> table
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||Something like
[script]
create table #MyTable(column1,column2,...,columnX)
go
insert into #MyTable (column1,column2,...,columnX) exec MyProcedure
[/script]
Cristian Lefter, SQL Server MVP
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u%23myVz9HFHA.3332@.TK2MSFTNGP14.phx.gbl...
>
> can any one advice me on how to insert the results of a SP into a temp
> table
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||Emil
INSERT INTO #Temp EXEC sp
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u%23myVz9HFHA.3332@.TK2MSFTNGP14.phx.gbl...
>
> can any one advice me on how to insert the results of a SP into a temp
> table
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||
evry ting
execp the SP returns 10 vals and i only need to use 2 of them...
how do i do that
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||Delete the others from the table after the INSERT. Or, a nasty workaround, i
s to call back to the
SQL Server as a linked server using either OPENQUERY or OPENROWSET and do SE
LECT TOP 2 from that
table valued function.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:u46$uU%23HFHA.1476@.TK2MSFTNGP09.phx.gbl...
>
> evry ting
> execp the SP returns 10 vals and i only need to use 2 of them...
> how do i do that
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||let my try and explain better...itonly returns one row..with 10
Columns..i onle need 2 of those ..not all 10...
thisis my question ...
create table #test
( mktcode int, rttotal float,
)
insert into #test (mktcode, rttotal)
exec sp...but the reslut gives me culmun a,b,c,d,e,f,g,
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||Well, with INSERT EXEC you get all. How about modifying the stored procedure
, or extracting the
relevant part of the procedure to make another suitable procedure. Or re-wri
te the procedure into a
table valued user defined function?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Emil Henrico" <emil@.interres.co.za> wrote in message
news:exVfFo%23HFHA.4076@.TK2MSFTNGP10.phx.gbl...
> let my try and explain better...itonly returns one row..with 10
> Columns..i onle need 2 of those ..not all 10...
> thisis my question ...
> create table #test
> ( mktcode int, rttotal float,
> )
> insert into #test (mktcode, rttotal)
> exec sp...but the reslut gives me culmun a,b,c,d,e,f,g,
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!|||Create a temporary Table Variable, say @.Tmp,
Declare @.Tmp Table (
Col1 Varchar(20),
Col2 Varchar(20),
Col3 Varchar(20),
..
Col10 Varchar(20))
Only make the column definitions match the output of the stored proc.
Then Insert @.Tmp Exec SP -- This inserts all ten values into @.Tmp
Then Insert from @.tmp into your real table.
Insert #test (mktcode, rttotal)
Select Col3, Col 7 From @.tmp -- WHichever 2 columns you want
"Emil Henrico" wrote:
> let my try and explain better...itonly returns one row..with 10
> Columns..i onle need 2 of those ..not all 10...
> thisis my question ...
> create table #test
> ( mktcode int, rttotal float,
> )
> insert into #test (mktcode, rttotal)
> exec sp...but the reslut gives me culmun a,b,c,d,e,f,g,
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>
Sunday, February 19, 2012
Hosting Environment - Advice please
(Please forgive me for cross posting on this one)
I am attemptign to offer some kind of hosting of SQL databases as an add-on
to a Web Platform i have built. Unfortunately my SQL knowlwedge is a little
short of l33t.
My question is this:
Is it better to write a web front end to allow the customer to adminsiter
their databases, or to allwo them access to Enterprise manager, from where
they can administer their databases.
thanks
Martin[dot]Christopher[at]uk[dot]easynet[dot]netI think it's a bit risky to give folks access to Enterprise manager, and
it's not usually the done thing. By using a tool you develop you can control
exactly what the customer can do.
"Martin c" <martin@.nospam.com> wrote in message
news:eINWglQfDHA.1888@.TK2MSFTNGP12.phx.gbl...
> (Please forgive me for cross posting on this one)
> I am attemptign to offer some kind of hosting of SQL databases as an
add-on
> to a Web Platform i have built. Unfortunately my SQL knowlwedge is a
little
> short of l33t.
> My question is this:
> Is it better to write a web front end to allow the customer to adminsiter
> their databases, or to allwo them access to Enterprise manager, from where
> they can administer their databases.
> thanks
> Martin[dot]Christopher[at]uk[dot]easynet[dot]net
>|||Yes, I think there is still a risk, but you could reduce this by using some
of the following:
You could use a stored procedure to execute their statements, and give the
user execute rights to this proc only.
By checking the type (sysobjects.type) of any tables they were trying to
access, you could limit their access to system objects.
"Martin c" <martin@.nospam.com> wrote in message
news:OFAWktQfDHA.556@.TK2MSFTNGP11.phx.gbl...
> I was considering a simple bit of ASP that allows them to riun SQL scripts
> (entered into a text box) on the server, and include some command
checking.
> The scripts would all be run under the contezt of the user in question.
> Would i be right in assuming though, that withough specific subroutines to
> avoid contact with any system databases, it would be possible for a
> malicious user to gleam enough information out of the server to launch an
> attackt hat has a fairly high probility of compramising the server ?
> M
>
> "Nick Hindle" <nick.hindle@.NOSPAMtesco.co.uk> wrote in message
> news:%23sS7GoQfDHA.460@.TK2MSFTNGP12.phx.gbl...
> > I think it's a bit risky to give folks access to Enterprise manager, and
> > it's not usually the done thing. By using a tool you develop you can
> control
> > exactly what the customer can do.
> >
> > "Martin c" <martin@.nospam.com> wrote in message
> > news:eINWglQfDHA.1888@.TK2MSFTNGP12.phx.gbl...
> > > (Please forgive me for cross posting on this one)
> > >
> > > I am attemptign to offer some kind of hosting of SQL databases as an
> > add-on
> > > to a Web Platform i have built. Unfortunately my SQL knowlwedge is a
> > little
> > > short of l33t.
> > >
> > > My question is this:
> > > Is it better to write a web front end to allow the customer to
> adminsiter
> > > their databases, or to allwo them access to Enterprise manager, from
> where
> > > they can administer their databases.
> > >
> > > thanks
> > > Martin[dot]Christopher[at]uk[dot]easynet[dot]net
> > >
> > >
> >
> >
>|||Thanks for your help here Nick. I'll go write soem code and see what i can
come up with.
M
"Nick Hindle" <nick.hindle@.NOSPAMtesco.co.uk> wrote in message
news:%23Fn9h3QfDHA.2400@.TK2MSFTNGP11.phx.gbl...
> Yes, I think there is still a risk, but you could reduce this by using
some
> of the following:
> You could use a stored procedure to execute their statements, and give the
> user execute rights to this proc only.
> By checking the type (sysobjects.type) of any tables they were trying to
> access, you could limit their access to system objects.
[SNIP]|||Hi Martin,
What kind of functions would you provide to the customer? If you want to
code yourself, it would require a lof of extra efforts if you want to
provide flexible management and functions.
If you fear that Enterprise Manager provides too many functions for
customer to easily destroy SQL Server databases, you can restrict their
permissions. And let them know that customers who do not need management
ability cannot install Enterprise Manager.
Bill Cheng
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--
| From: "Martin c" <martin@.nospam.com>
| Subject: Hosting Environment - Advice please
| Date: Wed, 17 Sep 2003 11:49:29 +0100
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eINWglQfDHA.1888@.TK2MSFTNGP12.phx.gbl>
| Newsgroups:
microsoft.public.sqlserver.security,microsoft.public.sqlserver.server,micros
oft.public.sqlserver.setup
| NNTP-Posting-Host: ninja.noc.uk.easynet.net 195.40.7.160
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:306886
microsoft.public.sqlserver.setup:57712
microsoft.public.sqlserver.security:15843
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| (Please forgive me for cross posting on this one)
|
| I am attemptign to offer some kind of hosting of SQL databases as an
add-on
| to a Web Platform i have built. Unfortunately my SQL knowlwedge is a
little
| short of l33t.
|
| My question is this:
| Is it better to write a web front end to allow the customer to adminsiter
| their databases, or to allwo them access to Enterprise manager, from where
| they can administer their databases.
|
| thanks
| Martin[dot]Christopher[at]uk[dot]easynet[dot]net
|
|
|
I am attemptign to offer some kind of hosting of SQL databases as an add-on
to a Web Platform i have built. Unfortunately my SQL knowlwedge is a little
short of l33t.
My question is this:
Is it better to write a web front end to allow the customer to adminsiter
their databases, or to allwo them access to Enterprise manager, from where
they can administer their databases.
thanks
Martin[dot]Christopher[at]uk[dot]easynet[dot]netI think it's a bit risky to give folks access to Enterprise manager, and
it's not usually the done thing. By using a tool you develop you can control
exactly what the customer can do.
"Martin c" <martin@.nospam.com> wrote in message
news:eINWglQfDHA.1888@.TK2MSFTNGP12.phx.gbl...
> (Please forgive me for cross posting on this one)
> I am attemptign to offer some kind of hosting of SQL databases as an
add-on
> to a Web Platform i have built. Unfortunately my SQL knowlwedge is a
little
> short of l33t.
> My question is this:
> Is it better to write a web front end to allow the customer to adminsiter
> their databases, or to allwo them access to Enterprise manager, from where
> they can administer their databases.
> thanks
> Martin[dot]Christopher[at]uk[dot]easynet[dot]net
>|||Yes, I think there is still a risk, but you could reduce this by using some
of the following:
You could use a stored procedure to execute their statements, and give the
user execute rights to this proc only.
By checking the type (sysobjects.type) of any tables they were trying to
access, you could limit their access to system objects.
"Martin c" <martin@.nospam.com> wrote in message
news:OFAWktQfDHA.556@.TK2MSFTNGP11.phx.gbl...
> I was considering a simple bit of ASP that allows them to riun SQL scripts
> (entered into a text box) on the server, and include some command
checking.
> The scripts would all be run under the contezt of the user in question.
> Would i be right in assuming though, that withough specific subroutines to
> avoid contact with any system databases, it would be possible for a
> malicious user to gleam enough information out of the server to launch an
> attackt hat has a fairly high probility of compramising the server ?
> M
>
> "Nick Hindle" <nick.hindle@.NOSPAMtesco.co.uk> wrote in message
> news:%23sS7GoQfDHA.460@.TK2MSFTNGP12.phx.gbl...
> > I think it's a bit risky to give folks access to Enterprise manager, and
> > it's not usually the done thing. By using a tool you develop you can
> control
> > exactly what the customer can do.
> >
> > "Martin c" <martin@.nospam.com> wrote in message
> > news:eINWglQfDHA.1888@.TK2MSFTNGP12.phx.gbl...
> > > (Please forgive me for cross posting on this one)
> > >
> > > I am attemptign to offer some kind of hosting of SQL databases as an
> > add-on
> > > to a Web Platform i have built. Unfortunately my SQL knowlwedge is a
> > little
> > > short of l33t.
> > >
> > > My question is this:
> > > Is it better to write a web front end to allow the customer to
> adminsiter
> > > their databases, or to allwo them access to Enterprise manager, from
> where
> > > they can administer their databases.
> > >
> > > thanks
> > > Martin[dot]Christopher[at]uk[dot]easynet[dot]net
> > >
> > >
> >
> >
>|||Thanks for your help here Nick. I'll go write soem code and see what i can
come up with.
M
"Nick Hindle" <nick.hindle@.NOSPAMtesco.co.uk> wrote in message
news:%23Fn9h3QfDHA.2400@.TK2MSFTNGP11.phx.gbl...
> Yes, I think there is still a risk, but you could reduce this by using
some
> of the following:
> You could use a stored procedure to execute their statements, and give the
> user execute rights to this proc only.
> By checking the type (sysobjects.type) of any tables they were trying to
> access, you could limit their access to system objects.
[SNIP]|||Hi Martin,
What kind of functions would you provide to the customer? If you want to
code yourself, it would require a lof of extra efforts if you want to
provide flexible management and functions.
If you fear that Enterprise Manager provides too many functions for
customer to easily destroy SQL Server databases, you can restrict their
permissions. And let them know that customers who do not need management
ability cannot install Enterprise Manager.
Bill Cheng
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--
| From: "Martin c" <martin@.nospam.com>
| Subject: Hosting Environment - Advice please
| Date: Wed, 17 Sep 2003 11:49:29 +0100
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eINWglQfDHA.1888@.TK2MSFTNGP12.phx.gbl>
| Newsgroups:
microsoft.public.sqlserver.security,microsoft.public.sqlserver.server,micros
oft.public.sqlserver.setup
| NNTP-Posting-Host: ninja.noc.uk.easynet.net 195.40.7.160
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:306886
microsoft.public.sqlserver.setup:57712
microsoft.public.sqlserver.security:15843
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| (Please forgive me for cross posting on this one)
|
| I am attemptign to offer some kind of hosting of SQL databases as an
add-on
| to a Web Platform i have built. Unfortunately my SQL knowlwedge is a
little
| short of l33t.
|
| My question is this:
| Is it better to write a web front end to allow the customer to adminsiter
| their databases, or to allwo them access to Enterprise manager, from where
| they can administer their databases.
|
| thanks
| Martin[dot]Christopher[at]uk[dot]easynet[dot]net
|
|
|
Subscribe to:
Posts (Atom)