473,883 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parameter for Stored Procedure

Hi
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
Thanks for any help
Dennis

'--------------------------------------------------------------------------*--------------------------------
Before - This Works without a paramater
'--------------------------------------------------------------------------*--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE [MyClientDatabas e] ON PRIMARY
( NAME = N'MyClientDatab ase',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MyClientDatab ase_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
'--------------------------------------------------------------------------*--------------------------------
After - This Doesn't work with a parameter
'--------------------------------------------------------------------------*--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE @ClientDBName ON PRIMARY
( NAME = N@ClientDBName,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'@ClientDBName ' + '_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .

Jun 16 '07 #1
5 3632
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
The database name must be a constant instead of a variable. You'll need
instead build and execute the create statement dynamically:

CREATE PROCEDURE [dbo].[sp_CreateNewCli entDb]
@ClientDBName sysname
AS
EXECUTE
(
'CREATE DATABASE ' + QUOTENAME(@Clie ntDBName) + ' ON PRIMARY
( NAME = N''' + @ClientDBName + ''',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '.mdf'' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N''' + @ClientDBName + '_log'',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '_log.ldf'' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS'
)
GO
--
Hope this helps.

Dan Guzman
SQL Server MVP

"Dennis" <DB******@CCC.H SHS.ORGwrote in message
news:11******** *************@q 75g2000hsh.goog legroups.com...
Hi
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
Thanks for any help
Dennis

'--------------------------------------------------------------------------*--------------------------------
Before - This Works without a paramater
'--------------------------------------------------------------------------*--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE [MyClientDatabas e] ON PRIMARY
( NAME = N'MyClientDatab ase',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MyClientDatab ase_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
'--------------------------------------------------------------------------*--------------------------------
After - This Doesn't work with a parameter
'--------------------------------------------------------------------------*--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE @ClientDBName ON PRIMARY
( NAME = N@ClientDBName,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'@ClientDBName ' + '_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .

Jun 16 '07 #2
On Jun 16, 6:53 am, "Dan Guzman" <guzma...@nospa m-
online.sbcgloba l.netwrote:
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.

The database name must be a constant instead of a variable. You'll need
instead build and execute the create statement dynamically:

CREATE PROCEDURE [dbo].[sp_CreateNewCli entDb]
@ClientDBName sysname
AS
EXECUTE
(
'CREATE DATABASE ' + QUOTENAME(@Clie ntDBName) + ' ON PRIMARY
( NAME = N''' + @ClientDBName + ''',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '.mdf'' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N''' + @ClientDBName + '_log'',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '_log.ldf'' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS'
)
GO

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Dennis" <DBARN...@CCC.H SHS.ORGwrote in message

news:11******** *************@q 75g2000hsh.goog legroups.com...
Hi
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
Thanks for any help
Dennis

'--------------------------------------------------------------------------**--------------------------------
Before - This Works without a paramater
'--------------------------------------------------------------------------**--------------------------------

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go

ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE [MyClientDatabas e] ON PRIMARY
( NAME = N'MyClientDatab ase',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MyClientDatab ase_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS

'--------------------------------------------------------------------------**--------------------------------
After - This Doesn't work with a parameter
'--------------------------------------------------------------------------**--------------------------------

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go

ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE @ClientDBName ON PRIMARY
( NAME = N@ClientDBName,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'@ClientDBName ' + '_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS

Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .

Now I get a different syntax problem.
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 6
Incorrect syntax near 'QUOTENAME'.

Jun 16 '07 #3
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .
Sorry, I tested with PRINT instead of EXECUTE and forgot that the a variable
is needed for EXECUTE. Try
CREATE PROCEDURE [dbo].[sp_CreateNewCli entDb]
@ClientDBName sysname
AS
DECLARE @SqlStatement nvarchar(4000)
SET @SqlStatement =
'CREATE DATABASE ' + QUOTENAME(@Clie ntDBName) + ' ON PRIMARY
( NAME = N''' + @ClientDBName + ''',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '.mdf'' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N''' + @ClientDBName + '_log'',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '_log.ldf'' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS'
EXEC (@SqlStatement)
GO
--
Hope this helps.

Dan Guzman
SQL Server MVP

"Dennis" <DB******@CCC.H SHS.ORGwrote in message
news:11******** **************@ q75g2000hsh.goo glegroups.com.. .
On Jun 16, 6:53 am, "Dan Guzman" <guzma...@nospa m-
online.sbcgloba l.netwrote:
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.

The database name must be a constant instead of a variable. You'll need
instead build and execute the create statement dynamically:

CREATE PROCEDURE [dbo].[sp_CreateNewCli entDb]
@ClientDBName sysname
AS
EXECUTE
(
'CREATE DATABASE ' + QUOTENAME(@Clie ntDBName) + ' ON PRIMARY
( NAME = N''' + @ClientDBName + ''',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '.mdf'' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N''' + @ClientDBName + '_log'',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '_log.ldf'' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS'
)
GO

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Dennis" <DBARN...@CCC.H SHS.ORGwrote in message

news:11******** *************@q 75g2000hsh.goog legroups.com...
Hi
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
Thanks for any help
Dennis

'--------------------------------------------------------------------------**--------------------------------
Before - This Works without a paramater
'--------------------------------------------------------------------------**--------------------------------

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go

ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE [MyClientDatabas e] ON PRIMARY
( NAME = N'MyClientDatab ase',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MyClientDatab ase_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS

'--------------------------------------------------------------------------**--------------------------------
After - This Doesn't work with a parameter
'--------------------------------------------------------------------------**--------------------------------

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go

ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE @ClientDBName ON PRIMARY
( NAME = N@ClientDBName,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'@ClientDBName ' + '_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS

Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .

Now I get a different syntax problem.
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 6
Incorrect syntax near 'QUOTENAME'.

Jun 16 '07 #4
On Jun 16, 8:27 am, "Dan Guzman" <guzma...@nospa m-
online.sbcgloba l.netwrote:
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .

Sorry, I tested with PRINT instead of EXECUTE and forgot that the a variable
is needed for EXECUTE. Try

CREATE PROCEDURE [dbo].[sp_CreateNewCli entDb]
@ClientDBName sysname
AS
DECLARE @SqlStatement nvarchar(4000)
SET @SqlStatement =
'CREATE DATABASE ' + QUOTENAME(@Clie ntDBName) + ' ON PRIMARY
( NAME = N''' + @ClientDBName + ''',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '.mdf'' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N''' + @ClientDBName + '_log'',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '_log.ldf'' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS'
EXEC (@SqlStatement)
GO

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Dennis" <DBARN...@CCC.H SHS.ORGwrote in message

news:11******** **************@ q75g2000hsh.goo glegroups.com.. .
On Jun 16, 6:53 am, "Dan Guzman" <guzma...@nospa m-

online.sbcgloba l.netwrote:
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
The database name must be a constant instead of a variable. You'll need
instead build and execute the create statement dynamically:
CREATE PROCEDURE [dbo].[sp_CreateNewCli entDb]
@ClientDBName sysname
AS
EXECUTE
(
'CREATE DATABASE ' + QUOTENAME(@Clie ntDBName) + ' ON PRIMARY
( NAME = N''' + @ClientDBName + ''',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '.mdf'' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N''' + @ClientDBName + '_log'',
FILENAME = N''C:\Program Files\Microsoft SQL
Server\MSSQL.2\ MSSQL\DATA\' + @ClientDBName + '_log.ldf'' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS'
)
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Dennis" <DBARN...@CCC.H SHS.ORGwrote in message
news:11******** *************@q 75g2000hsh.goog legroups.com...
Hi
I'm trying to alter my stored procedure to take a parameter for the
Database Name, but as usual the syntax is killing me.
Thanks for any help
Dennis
'--------------------------------------------------------------------------***--------------------------------
Before - This Works without a paramater
'--------------------------------------------------------------------------***--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE [MyClientDatabas e] ON PRIMARY
( NAME = N'MyClientDatab ase',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MyClientDatab ase_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\MyClientDataba se_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
'--------------------------------------------------------------------------***--------------------------------
After - This Doesn't work with a parameter
'--------------------------------------------------------------------------***--------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER PROCEDURE [dbo].[sp_CreateNewCli entDb]
AS
CREATE DATABASE @ClientDBName ON PRIMARY
( NAME = N@ClientDBName,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '.mdf' ,
SIZE = 11264KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
LOG ON
( NAME = N'@ClientDBName ' + '_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.2\ MSSQL\DATA
\@ClientDBName' + '_log.ldf' ,
SIZE = 1024KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_Gene ral_CP1_CI_AS
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 4
Incorrect syntax near '@ClientDBName' .

Now I get a different syntax problem.
Msg 102, Level 15, State 1, Procedure sp_CreateNewCli entDb, Line 6
Incorrect syntax near 'QUOTENAME'.- Hide quoted text -

- Show quoted text -
Thank you very much. It works great... :)
Now I'll try to fight my way through building tables using the
variable name.

Jun 16 '07 #5
>Now I'll try to fight my way through building tables using the variable name. <<

Can you explain your thinking on this? A schema is a realization of a
data model and you ought to know the name and particulars of it before
you create it. But you want to have a user create a whole new universe
on the fly. It is bad enough when people write dynamic SQL to build
tables on the fly -- the logical equivalent of magically producing
elephants from the sky.

Jun 17 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3853
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the returned autogenerated Identity is wrong (on the VB side). This only occurs if the length of the value inserted for the text column is >= 8002. I've included a simple example below.
3
16952
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can create a parameter query in a stored procedure, but how do I use the result set of a parameter query in a select query (in the same or another sp)? In short, if a select query contains a result table that is generated as a parameter query, how do I...
1
12132
by: Agoston Bejo | last post by:
Hi! I am trying to pass a VBScript Date variable as value to an ADO adDate parameter of a stored procedure (which runs in an SQL Server). If I add the parameter like this: oCmd.Parameters.Append oCmd.CreateParameter( "@p_Date", adDate, adParamInput, , dParam) where oCmd is of type ADODB.Command and dParam is a VBScript variable of type Date
8
4462
by: Christopher Weaver | last post by:
I'm having trouble accessing the value of an output parameter of a stored procedure. The SP looks like this: SET TERM ^ ; CREATE PROCEDURE SP_NEW_TASK RETURNS ( "uidTask" INTEGER) AS begin
2
2443
by: Robert E. Flaherty | last post by:
I am using System.Data.OracleClient (Oracle Provider for OLE DB 9.2.0.4.0) in an ASP.NET 1.1 app. I am evoking a stored procedure with a number of input parameters and two output parameters, both declared ParametrerDirection.InputOutput. The first of these two output parameters is an integer value. It is the status of the running of the stored procedure. It is working fine. The second parameter is designed to return a message from...
1
2652
by: Rob Richardson | last post by:
Greetings! I have a SQL Server stored procedure that takes one parameter, named @key. I am trying to run that stored procedure from a VB app. When I create a Parameter object and give it the name "key", I get an error message that says "key is not a parameter for procedure sp_get_active_holdings". When I name the parameter "@key", I get a message that says "Procedure 'sp_get_active_holdings' expects parameter '@key', which was not...
4
2770
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx to a stored procedure on the details2.aspx page. I can successfully pass the values from the listbox control to a
5
9881
by: Enyi | last post by:
Just like my last post I cannot solve this problem with a stored procedure in MSSQL Server 2000 Developer Edition. I am trying to use the parameter in VB.NET 2003. When I run the VB code and execute the stored procedure, the exact error message is: "Parameter1 is not a parameter for procedure EditCustomer." The only thing is it is a parameter for the procedure. I would appreciate any help with this one. Most probably an obvious, simple...
9
2703
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio and run it once you've made sure there is no harmful code. Currently we have several stored procedures which final result is a select with several joins that returns many
7
7079
by: jamesclose | last post by:
My problem is this (apologies if this is a little long ... hang in there): I can define a function in VB.NET with optional parameters that wraps a SQL procedure: Sub Test(Optional ByVal Arg1 As Integer = 0, _ Optional ByVal Arg2 As Integer = 0, _ Optional ByVal Arg3 As Integer = 0) ' Call my SQL proc with the same signature
0
9945
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9798
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7978
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6007
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4622
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4230
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.