Forum Replies Created

Viewing 15 posts - 106 through 120 (of 168 total)

  • RE: catching errors

    Change the Insert statement like this

    insert

    @exception(addressException, errorID)

    select

    substring(a

  • RE: Changing Font for query output

    I think, Logically it is not possible to format the data with SQL.

    Formatting data is part of the calling Application,

    you can workaround this by using HTML tags in Query...

  • RE: Selecting data to update a row

    Your SQL will perfectly works,if the data contains different months i.e, your subquery should not return more than 1 value

    try to identify the rows uniquely

     

  • RE: Begin Transaction

    when SET XACT_ABORT ON statement transaction is terminated and rolled back implicitly

    If any error occurs in Update statement, It wont go to the IF condition after that because of SET...

  • RE: How to pass in database name for DDL script

    Try this

    Create

    Procedure CreateView(@dbname as sysname)

    as

    begin

    declare

    @sql

  • RE: Query dfinition help

    You can use this also

    select

    *

    from

    table1

    where

    (select count(PERMIT_ID

  • RE: Create Table with Dynamic Columns

    You can mimic the functionality of arrays by using split function ( I saw somewhere in the group  called fn_split which splits the input separated by comma)

    store the results in...

  • RE: duplicate entries in a field

    I created a function to count the commas in the address field like

    Create Function CountCommas(@str varchar(4000)) returns int as

    begin

    Declare @i int,

     @count int

    set @i=1

    set @count=0

    while @i>0

    begin

     set @i =charindex(',',@str)

     set @STR=substring(@str,@i+1,len(@str))

     set...

  • RE: duplicate entries in a field

    I assumed that duplicate city is separated by ','

    If not, what are all the characters separating two values.

    If both are not separated by any of the characters then what is...

  • RE: duplicate entries in a field

    You can try this also

    update Tab_test

    set name=LEFT (name, LEN(rtrim(name)) - CHARINDEX(',', REVERSE(rtrim(name))))

    Added rtrim to Nagabhushanam  approach

     

  • RE: duplicate entries in a field

    TRY THIS

    Assumed ',' will be the separator between the duplicates and repeated city name is the last word in the Address

    Ex: Updated Name column in Tab_Test table

    UPDATE TAB_TEST

    SET NAME=reverse(substring(reverse(rtrim(name)),charindex(',',reverse(rtrim(name)))+1, len(reverse(rtrim(name)))...

  • RE: Where did the option "Delete rows in destination table" go?

    Add an "Data Flow Task" Event Handler "OnPreExecute" 

    Add "Execute SQL Task" to EventHandler  enter delete statement for that table in SQL Task

    hope it will solve your problem

  • RE: Error In SSIS Designer

    If you are able to see control flow, data flow,package explorer tab you can also see Exection Results tab in Design mode

    In that tab also you will find errors occured

     

  • RE: Error In SSIS Designer

    Just Click on Debug -> Windows -> Immmeditate

    It will show you the Immediate window

  • RE: Error In SSIS Designer

    You can see the errors in Immediate window while debugging the Package

Viewing 15 posts - 106 through 120 (of 168 total)