Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GREAT PROBLEM : Stored procedure with parameters

Status
Not open for further replies.

jando

Technical User
Nov 11, 2003
1
DE
Hi folk,

here is my problem:
I realized a VB application that pass a parameter into a stored procedure that creates a new database.
The application doesn't work!
I know that passing the parameters is ok, cause I tested it passing a parameter with a simple stored procedure to create a SELECT.

DB_NEGOZIO2 is my DB's name.
@vch_DBshop is the parameter of the stored procedure that contains the DB's name
I copied this script from SQL (generate script):
-------------------------------------------
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'DB_NEGOZIO2')
DROP DATABASE [DB_NEGOZIO2]
GO

CREATE DATABASE [DB_NEGOZIO2] ON (NAME = N'DB_NEGOZIO2_Data', FILENAME = N'e:\sql server data\MSSQL\data\DB_NEGOZIO2_Data.MDF' , SIZE = 1, FILEGROWTH = 10%) LOG ON (NAME = N'DB_NEGOZIO2_Log', FILENAME = N'e:\sql server data\MSSQL\data\DB_NEGOZIO2_Log.LDF' , SIZE = 1, FILEGROWTH = 10%)
COLLATE SQL_AltDiction_CP850_CS_AS
GO

exec sp_dboption N'DB_NEGOZIO2', N'autoclose', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'bulkcopy', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'trunc. log', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'torn page detection', N'true'
GO

exec sp_dboption N'DB_NEGOZIO2', N'read only', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'dbo use', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'single', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'autoshrink', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'ANSI null default', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'recursive triggers', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'ANSI nulls', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'concat null yields null', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'cursor close on commit', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'default to local cursor', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'quoted identifier', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'ANSI warnings', N'false'
GO

exec sp_dboption N'DB_NEGOZIO2', N'auto create statistics', N'true'
GO

exec sp_dboption N'DB_NEGOZIO2', N'auto update statistics', N'true'
GO

use [DB_NEGOZIO2]
GO
-------------------------------------------
I'd like to substitute the DB's name with the parameter, rendering dynamically the SQL script.


However, if you have got a stored procedure with parameters that creates a sql database that works in a different way,
i would be very pleased to receive it!
I just need to create this database, having as INPUT the db's name, in every possible way.

 
I think that this is more a problem with your vb code than with your sql statment. maybe if you asked in the vb fourm someone could help you there. good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top