User Profile

Collapse

Profile Sidebar

Collapse
allik7
allik7
Last Activity: Mar 23 '08, 01:19 PM
Joined: Feb 4 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • allik7
    replied to While Loop
    This is the code in the instead of insert trigger

    ALTER TRIGGER [Cust_Audit] ON [dbo].[Customer]
    INSTEAD OF INSERT
    AS

    DECLARE @CustNum int
    DECLARE @CustomerCode INT,@CustomerId entificationTyp e INT
    DECLARE @CustomerIdenti ficationGroupCo de CHAR(50),@Docum entNumber CHAR(50)
    DECLARE @FirstName CHAR(50),@LastN ame CHAR(50),@Middl eName CHAR(50)
    DECLARE @CustomerName CHAR(50)...
    See more | Go to post
    Last edited by allik7; Mar 21 '08, 01:50 PM. Reason: left out a point

    Leave a comment:


  • allik7
    started a topic While Loop

    While Loop

    Hi All

    I need some help again. I am using a instead of insert to update and insert records. When I am doing multiple records i get am error

    Subquery returned more than 1 value. This is not permitted when the
    subquery follows =, !=, <, <=, <, >= or when the subquery is used as an
    expression.

    So i am thinking of using a cursor to do this.
    Am i right in wanting to use...
    See more | Go to post

  • allik7
    started a topic Trigger ISSUE

    Trigger ISSUE

    I have a problem that i cant seem to find out why i am getting this error when updating table I am get error saying cant in NULL in field name CreateByUser.
    I am using a INSTEAD OF INSERT Trigger. This trigger is triggered from a store procedure with the information is transfer via a XML file. The insert of a new record is done without any problem. Can someone help Below is the update code

    BEGIN
    UPDATE Customer...
    See more | Go to post

  • allik7
    started a topic Trigger problem

    Trigger problem

    [CODE=sql]SET QUOTED_IDENTIFI ER ON
    GO
    SET ANSI_NULLS ON
    GO

    ALTER TRIGGER [Cust_Audit] ON [dbo].[Customer]
    INSTEAD OF INSERT
    AS

    DECLARE @CustNum int
    DECLARE @CustomerCode INT,@CustomerId entificationTyp e INT
    DECLARE @CustomerIdenti ficationGroupCo de CHAR(50),@Docum entNumber CHAR(50)
    DECLARE @FirstName CHAR(50),@LastN ame CHAR(50),@Middl eName CHAR(50)
    ...
    See more | Go to post
    Last edited by debasisdas; Feb 27 '08, 12:08 PM. Reason: added code=sql tags

  • allik7
    replied to Syntax error in the case statment
    Delerna suppose i want to place the slection in a temp table where would i put the INSERT INTO #TEMP
    See more | Go to post

    Leave a comment:


  • allik7
    replied to Syntax error in the case statment
    I did what u said i should do and the error went somewhere else the error now look like this
    Msg 4104, Level 16, State 1, Line 1
    The multi-part identifier "D.TransactionT ype" could not be bound.
    Msg 207, Level 16, State 1, Line 1
    Invalid column name 'TransactionId' .
    Msg 4104, Level 16, State 1, Line 1
    The multi-part identifier "T.TransactionD ate" could not be bound.
    Msg 4104, Level...
    See more | Go to post

    Leave a comment:


  • allik7
    replied to SQL Syntax Error
    Incorrect Syntax at RTRIM copy and paste it in query and you will see the error
    thanks in advance
    See more | Go to post

    Leave a comment:


  • allik7
    started a topic Syntax error in the case statment

    Syntax error in the case statment

    I am have a problem with this section of code. When I place the select statemnet in a string variable i get an syntax error at RTRIM. Can the Case section be used in a string variable i am wondering

    Cust_Org_Name =
    CASE WHEN C.CustomerType ='+'I'+'THEN RTRIM(CL.Lastna me)
    WHEN C.CustomerType = '+'E'+'THEN RTRIM(CL.Custom ername)
    END,

    Thanks for your assistance
    See more | Go to post

  • allik7
    replied to how to hndle month
    Why not use datatype char/varchar...
    See more | Go to post

    Leave a comment:


  • allik7
    started a topic SQL Syntax Error

    SQL Syntax Error

    [code=sql]
    Declare @String as nVarChar(1000)

    Declare @Ind as Char(1),@Com as Char(1),@BAC3 as Char(1)
    Declare @BAC1 as Char(1),@BAC2 as Char(1),@BAC4 as Char(1)
    Declare @current as varChar(7),@sav ing as varChar(6)
    Declare @move as varChar(12),@Ot her as varChar(5)
    Declare @new as varChar(3),@old as varChar(3),@bac k as varChar(10)

    set @Ind = 'I'
    set @Com = 'E'
    set @BAC1...
    See more | Go to post
    Last edited by debasisdas; Feb 5 '08, 04:08 AM. Reason: added code=sql tags
No activity results to display
Show More
Working...