Defining a concatenated column size

From: Kirk (Kirk_at_discussions.microsoft.com)
Date: 06/18/04

  • Next message: Hugo Kornelis: "Re: Defining a concatenated column size"
    Date: Fri, 18 Jun 2004 07:49:01 -0700
    
    

    I have a column within a view that is a concatenation of several different columns of another table. It goes something like: tblA.columnA + '-' tblA.columnB + '-' tblA.columnC + '-' tblA.columnD As 'NewColumn'

    Is it possible to define the size of the 'NewColumn' within the view? I have a stored procedure that is going to create a temp table based on this view, but when I execute the stored procedure I get the following error:

    Line 1: Incorrect syntax near '*'.

    In looking at the stored procedure code, the error is a result of when the create table occurs, it defines the NewColumn as nvarchar(*), which is causing the error.

    Any help would be appreciated.

    Thanks.


  • Next message: Hugo Kornelis: "Re: Defining a concatenated column size"

    Relevant Pages

    • Re: Defining a concatenated column size
      ... I have a stored procedure that is going to create a temp table based on this view, but when I execute the stored procedure I get the following error: ... >In looking at the stored procedure code, the error is a result of when the create table occurs, it defines the NewColumn as nvarchar, which is causing the error. ... may also choose to trim explicitly, using LEFT or CAST function). ...
      (microsoft.public.sqlserver.mseq)
    • Re: Error 1943 - ? bug in SQL Agent
      ... procedure logic is dependent on certain settings. ... everyone has posted the relevants bits about creating the stored procedure, ... the creation of the temp table). ... triggers on the updated tables to determine if they might be causing the ...
      (microsoft.public.sqlserver.programming)
    • Re: Error 1943 - ? bug in SQL Agent
      ... > procedure logic is dependent on certain settings. ... If you post the stored procedure (or at least a complete ... the creation of the temp table). ... > triggers on the updated tables to determine if they might be causing the ...
      (microsoft.public.sqlserver.programming)
    • Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored
      ... > recordsets will inherit properties. ... characteristics of the stored procedure that is causing the multiple ... declare @Temp int ...
      (borland.public.delphi.database.ado)
    • Re: SQLserver and the WHERE x IN y
      ... to a stored procedure - that would only work if you introduced subtyping into ... the temp table from the calling procedure (the temp table is still in scope, ... INSERT INTO #MyTempTable EXECUTE YourPopulateProc 123 ... INSERT INTO @MyTableVar VALUES ...
      (microsoft.public.sqlserver.programming)