Re: Problems creating stored procedure using command text

From: Grzegorz Danowski (gdn_at_usuntopoczta.onet.pl)
Date: 10/11/04


Date: Mon, 11 Oct 2004 12:25:53 +0200

Użytkownik "Paul Say" <saywin@tpg.com.au> napisał w wiadomości
news:%23ieRdZyrEHA.2008@TK2MSFTNGP12.phx.gbl...
>I am trying to write a program to create a database by executing the T-SQL
>statments for the databases Tables, Views Stored Procedures etc. I have a
>file that contains all the T-Sql Script. The program I have written will
>create the tables ok, the views and even some of the stored procedures
>however any stored procedures like the one listed will not execute as the
>quotes seem to cause a problem. The error I get for example says invalid
>Column name 'Select l.x, c.vendor', i ge this for each quoted line.
>
> Stored Procedure
>
> /****** Object: Stored Procedure dbo.RPF_CommitmentItem_GetAll Script
> Date: 8/10/2004 4:17:04 PM ******/
> CREATE PROCEDURE RPF_CommitmentItem_GetAll
> @Coid int,
> @CommitmentId nvarchar(12),
> @Filter nvarchar(500) = '1=1'
> AS
> Declare @SQL nvarchar(500)
> SET @SQL = "Select i.*, c.Vendor "
(...)

Try use ' instead of "
Set @SQL = 'Select i.*, c.Vendor '
etc.
Grzegorz



Relevant Pages

  • iFTS Search Results question
    ... database table to house search results that are generated by executing ... several stored procedures. ...
    (microsoft.public.sqlserver.fulltext)
  • Problems creating stored procedure using command text
    ... I am trying to write a program to create a database by executing the T-SQL ... Views Stored Procedures etc. ... Code to execute string containing the above ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Simple question but smart answer!
    ... data centric application and having business logic in sql. ... While T-SQL takes a performance hit from being an interpreted language, this usually pales to the performance hit from shuffling data over the network. ... putting as much "trivial" consistency and validation in your database as possible is still a good idea. ... This is also another argument against putting your business logic in stored procedures: you'll have to devise a consistent, machine-readable way for reporting errors back and stick to it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Database Model - Class, objects and interaction
    ... I was just proving stored procedures can call views. ... stuff like security and logging. ... So given 100,000 users, you would create database accounts for each? ... Part of our system's integrity was its reliability, and reliability is often assisted by simplicity. ...
    (comp.object)
  • Re: Database Model - Class, objects and interaction
    ... Stored procedures should only be used as a last resort if you cant use ... I've not said that views shouldn't be created, only that they shouldn't be exposed as the interface to the database. ... But business rules can be more complicated than simply defining overdue invoices. ...
    (comp.object)

Loading