Forum Replies Created

Viewing 15 posts - 286 through 300 (of 314 total)

  • RE: Need help with date comparison

    Here you.

    insert into AUDITS(ticket_id,owner,action_cd,last_updated_dt)

    select ACCEPT.ticket_id, TICKETS.owner, 'Expired',getdate() --ACCEPT.last_updated_dt as AcceptedDate ,

     --COMPLETE.last_updated_dt as CompletedDate,

     --Datediff(d,ACCEPT.last_updated_dt , getdate())

     from AUDITS ACCEPT INNER JOIN TICKETS ON ACCEPT.ticket_id = TICKETS.ticket_id

      LEFT OUTER JOIN

      (SElect * from AUDITS...

  • RE: Migrate MS SQL Server to New Box

    And if you want to be able to bring the new SQL Server with the old SQL Server name, here is the link too(ofcourse you need to rename the physical...

  • RE: Fetching file from FTP and running DTS

    You can do this 2 ways:

    Try using "Dyanmic Propert Task" to dynamically change the connection attributes.

    DTS Load from Specific Loaction

    1.Create ActiveX Script or TSQL (using xp_cmdshell) to Copy the Excel...

  • RE: How to tell if a character exists

    Ben,

    Try this.

     

    Declare @s_Data varchar(50),

     @s_ID varchar(50)

    set @s_Data = '5ABC1238990'

    set @s_ID =''

    select @s_Data

    If IsNumeric(Right(@s_Data,1)) =1

    Begin

     while IsNumeric(Right(@s_Data,1)) =1

     Begin

      set @s_ID = Cast(Right(@s_Data,1) as char(1)) + @s_ID

      set @s_Data = left(@s_Data,len(@s_Data)-1)

     End

     select @s_Data,@s_ID

    End

    If...

  • RE: How to tell if a character exists

    Do you know what the width of the Number is supposed to be (for example last 3 Charaters are ID etc)?

    Does it have a specific character that seperates Characters and...

  • RE: DTS Task Return Codes

    Search BOL for DTSTransformStat_SkipRow. The second article that you find called "DTSTransformStatus" will you the list.

    Hop this helps

    Thanks

    Sreejith

  • RE: Using CASE inside where clause

    If you don't need Case in the WHERE CLAUSE you can use the following:

    If @iscustomer is Null

    Begin

     SELECT * FROM users

    End

    Else

     If @iscustomer='Y'

     Begin

      Select UserId,UserName from users where exists (SElect 1 from...

  • RE: Job Fails When Run Automatically

    If possible Terminal into the Server or Logon to the server with the account that SQL Agent uses and try running it manually that will tell you what kind of...

  • RE: Distinct

    Getting "Dupe" was a bad design to begin with.

    Removing Dupes(or De-Duping as I call it) would require logic on which one survives. The most current(Using datetime field, or Max of...

  • RE: Summarizing Several Fields of a table.

    Have u tried using Cube Operator. This will help you summarize at different levels and you can query the columns and summary that you need.

    SELECT Item, Color, SUM(Qty) AS QtySum

    FROM tbl_Inventory

    GROUP...

  • RE: Trying to load new records using the identity field from Master and pass to child

    Try this:

    BEGIN   

     INSERT INTO transactional_gldepartment_budgetlist(gldepartment,gldepartmentname,budgetyear,entrydate)

       VALUES(@DPTNO,@DPTNAME,@YEAR,@ENTRYDATE)

     SELECT @err = @@error

     IF @err <> 0

     BEGIN

      ROLLBACK TRANSACTION

      RETURN

     END

     ELSE

     BEGIN

      SELECT @BudgetID =  SCOPE_IDENTITY( )

      INSERT INTO transactional_deptbudget(dbudgetid,budgetaccount,budgetaccountname)

      SELECT DISTINCT @BudgetID,budgetaccountnumber,budgetdescription FROM lookup_budgetaccounts

       WHERE budgetaccountnumber...

  • RE: Validation queries running too long

    How many rows are there in the table. Can you create an Index on ProjectID cos you use it so many places?

    Thanks

    Sreejith

  • RE: Table content to spreadsheet

    In query analyzer you can export the result to text.

    Query Analyzer->Tools->Options->Results->

    Set Default Result Target = "Result to File"

    Result output Format ="CSV"

    This will get you results in csv (It will...

  • RE: Validation queries running too long

    One of the things I see is that you do a validation on all the phones every time. Since you are going to use only the ones associated with the...

  • RE: trying use a cursor to update a table

    Can you please explain what you are trying to do?

    Are you trying to do this:

    Update CONTENC set periodo =periodo+ periodo1+periodo2???

    If you can answer this I will be able to help...

Viewing 15 posts - 286 through 300 (of 314 total)