Re: Host Variable

Tech-Archive recommends: Fix windows errors by optimizing your registry



Not sure what you mean by a "host variable". However, a variable in SQL
Server is done via a DECLARE:

declare
@MyVar1 int
, @MyVar2 varchar (20)

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Alex" <wittler@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23q9pGxD6JHA.676@xxxxxxxxxxxxxxxxxxxxxxx
Hi

How can I declare a host variable in SQL Server? The documentation says, it
shall begin with "EXEC SQL BEGIN DECLARE SECTION;" ..., but with this I only
get a syntax error.

If someone knows the correct syntax also for Oracle, it would be much more
usefull to me.

Many Thanks, Alex

.



Relevant Pages

  • SQL SERVER 2000 domain changes for users.
    ... In the SQL server, we have ... how to change users login name in sql 2000 SP4 after domain change... ... DECLARE @charvalue varchar ... -- temporary srvrole access table ...
    (microsoft.public.sqlserver.server)
  • Re: return a value using MDX
    ... From [Total Revenue] ... but I am getting a syntax error with the. ... it is looking for @sql as well. ... DECLARE @sql varchar ...
    (microsoft.public.sqlserver.olap)
  • Re: Scripts failing without error
    ... I would start by using the SQL Profiler to see what is sent server side... ... DECLARE @version nvarchar ... DECLARE @cmduser varchar ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: JET Database errors
    ... I checked the sql of the page and it appears to be correct. ... to edit any records in any databases on my server give the same error). ... a copy of JET Database update 4.0, but I'm not going to install it until I ... > The first thing I would check for is a syntax error in the UPDATE ...
    (microsoft.public.frontpage.programming)
  • Re: problem with stored proc
    ... ALTER PROCEDURE dbo.AddAdminUser ... The syntax error is caused because CREATE USER cannot take a variable as an argument. ... You can work around this by executing the proc using dynamic SQL: ... DECLARE @sql varchar ...
    (microsoft.public.sqlserver.msde)