Re: Stored procedure in Dynamic DB



You are right and the sql server suppose to do this but it can't do this
..... I have created the database dynamically and after I used USE command
and then Created all the stored procedures after but it was giving me an an
error which I stated in earlier email.

Thanks

"David Gugick" <david.gugick-nospam@xxxxxxxxx> wrote in message
news:uTQLm24kFHA.1412@xxxxxxxxxxxxxxxxxxxxxxx
> msnews.microsoft.com wrote:
> > Yes David, that's what I am asking you.... I am creating dynamic
> > database and after creating the database I want to create procedures
> > in it .... database created successfully and records have been
> > inserted successfully but when I try to create Stored Procedure then
> > there is giving me an error like I should in that database .... so
> > the question is that can I do this dynamically?
> >
>
> You can, but as I stated, you need to _be_ in that database first. So
> create the database and then change context to it using USE [New
> Database Name] and then create the procedures. I can't tell from your
> post whether or not this is run as a single script or there is a client
> application at work here. If you have an application driving the
> creation of the database, then do this:
>
> - Connect to the server
> - Execute the CREATE DATABASE script
> - Change context to the new database using a USE statement
> - Execute the scripts to create the stored procedures and leave off the
> database name
>
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>


.



Relevant Pages

  • Re: Cannot Open SQL Server Table in Access.ADP File.
    ... Other possiblities would be that you didn't refresh the database window ... I have an SQL Server 2005 database which functions properly with my ... the Generate Script Wizard to recreate the SQL Server Database. ... Then, If I attempt to open another table, it opens. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: SQL Security
    ... except I'm having problems making it work in a script. ... ;Set properties of DB objects and open connection to database ... > from Books Online (within the SQL Server program group): ... > communicate with SQL Server. ...
    (microsoft.public.sqlserver.server)
  • Re: Cannot Open SQL Server Table in Access.ADP File.
    ... I dont think that SQL Server will take 'veiw dependencies' into effect; ... Generate Script Wizard did not work on my original database, ... After fixing some of my tables and a few stored procedures and views, ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Connecting to SQL Server Express 2005
    ... Microsoft KB (which was referenced in the very useful DataBase Journal ... generated script against my test database. ... The SQL server produced the following list of errors: ... Line 2: Incorrect syntax near 'GO'. ...
    (microsoft.public.sqlserver.connect)
  • Re: Unable to view system stored procedures from .NET IDE and unable to debug SQL
    ... But what is the reason for the debug problem I mentioned below? ... try to step into a stored procedure in the Northwind database, ... Run SQL server setup or contact database ... I can't see any system stored procedures in master. ...
    (microsoft.public.dotnet.framework.adonet)

Loading