Re: how do i switch current database



RP wrote:
in my sproc, i have a list of databases on the server.  i want to run
a system stored procedure (like sp_spaceused) that run against the
current database.  how do i scroll through my list of db's and run
the sproc against each one?

Exec sp_executesql N'Use mydb Exec sp_spaceused'

--
David Gugick
Imceda Software
www.imceda.com
.



Relevant Pages

  • Re: Bit surprised there arent more virtual listbox controls/code available
    ... How about stick the MIDI data into a recordset then as a listbox can only ... would scroll the list as if it was a normal full listbox. ... You mean, display, say, 20 rows in the list box (e.g events 0 through ... processing would be standard database stuff. ...
    (microsoft.public.vb.general.discussion)
  • Re: Distributed queries
    ... I myself have no problem with the practice of a sproc getting data from ... The BLL approach is nice, because as you say, it is obvious. ... database deployments is that the network is not free. ... > the question really comes down to using stored procedures or .Net code to> implement our business logic. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Timeout on populating a datagrid
    ... The sproc is reading not updating any database, ... >>Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: architecture question
    ... At worst, business logic may be placed into those methods but I cannot think of a single reason why business logic would ever have to go any "lower" than that (i.e., right in a sproc). ... with pointing out that a database probably needs to be denormalized to some extent to make it faster way before anyone should ever put business logic into a sproc. ... But I do think there are some pretty basic guiding principles that should be adhered to, or in this case principles that should be completely avoided. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Copy/Highlight Content
    ... highlight below the end of the window the same thing happened. ... The issue is to copy and scroll beyond the bottom of the window and stop at ... Hmmmm, this isn't a normal indication of database corruption, but we need to ...
    (microsoft.public.mac.office.entourage)