Forum Replies Created

Viewing 15 posts - 121 through 135 (of 148 total)

  • RE: Parse Postcode from Multiple Address Fields

    Hi Tim,

    Unfortunately what I know about C# could be comfortably squeezed onto the back of a postage stamp. I've been telling myself for ages that I need to get onto...

  • RE: need help in writing query

    Using UNPIVOT would help here:

    declare @temp5 table (T1 int, T2 int, T3 int)

    insert @temp5

    select 1,2,3

    union all select 3,4,5

    union all select 5,6,7

    declare @Nic table (Id int)

    insert

  • RE: Mulit-part identifier error

    Change the middle bit:

    select

    dm.Company, dm.Acct_Unit, dm.Description, dm.Dept_Type

    From dbo.Dept_Master_old dm

    inner join dbo.Dept_Master_old ON fbdetail.Acct_unit = dm.ACCT_UNIT

  • RE: Comparing date fields in the same Row

    How about

    case when DATEDIFF(dd,ISNULL(CLC.BILLDATE,GETDATE()),GETDATE())>2 then 1

    when {next date field} then 1 ... etc

    else 0

    end = 0

    Regards, Iain

  • RE: Mulit-part identifier error

    Hi,

    You've declared the table alias inner join @fiscalyears fa within the cte. As a result, you cant use it outside when you try to join on Acct_Unit.

    You need to use...

  • RE: deleting data from multiple access tables from sql

    Hi,

    I'm assuming that the reason you're doing this is to provide a subset of your SQL data to the Access DB, which changes over time? If so, you'll be much...

  • RE: strange query to get data

    No worries, happy to help.

    Just noticed that you mention 'resultset' in your OP. If the output from your proc is multiple rows then you won't be able to do...

  • RE: strange query to get data

    Hi Andrew,

    Pass your output parameter from the stored procedure in using a variable. Here's a simple example:

    create procedure dbo.test

    @input int

    , @output int output

    as

    begin

    select @output = @input + 1

    end

    -----------------------------

    declare @result...

  • RE: getdate() problem

    Pass your date in as a variable:

    declare @mydate datetime

    set @mydate = getdate()

    select func_x(@mydate ,1)

    Iain

  • RE: Formatting results

    Hi,

    You can avoid all those isnulls with concat_null_yields_null:

    declare @a varchar(4),

    @b-2 varchar(4),

    @C varchar(5),

    @d varchar (4),

    @e varchar(20)

    set @a = 'aaa'

    set @b-2 =...

  • RE: Query to ignore common records

    It will if you add a flag for the source:

    ;with cte as (

    select *, 'A' as IPSource from @SourceA

    ...

  • RE: Query to ignore common records

    Hi,

    WayneS - think your solution is missing ABC's duplication?

    how about using a pivot to truly get one row per server (using WayneS's test data):

    ;with cte as (

    select * from @SourceA

    union

    select...

  • RE: Help with BULK INSERT of Unicode File

    Hi,

    Looks like your row and field terminators aren't being recognised or data within your file is being misinterpreted. Have you seen this?

    http://msdn.microsoft.com/en-us/library/ms191485.aspx

    Note from link:

    When you use native or...

  • RE: Package FAIL on 2k8 SQL Agent Run

    Hi Elliott,

    Unfortunately I can't upgrade the packages. I don't have access to the server they're being deployed on and the client won't undertake development work on them.

    I should be able...

  • RE: Package FAIL on 2k8 SQL Agent Run

    Hi Elliott,

    Each task is a data flow task comprising of a flat file source, a data conversion, a dervived column calculation, then an insert into a SQL Server table. Failed...

Viewing 15 posts - 121 through 135 (of 148 total)