Forum Replies Created

Viewing 15 posts - 7,246 through 7,260 (of 15,381 total)

  • RE: Remembering that it is good to "get back to basics" every now and then

    Lowell (8/6/2013)


    no, you should say "Because @@rowcount is affected by any commands in the session, it's my practice to re-select from the table in case there was a trigger that...

  • RE: Pivot on two columns

    Please in the future post ddl and sample data in a consumable format. Look at this as an example.

    if OBJECT_ID('tempdb..#Something') is not null

    drop table #Something

    create table #Something

    (

    Account int,

    MyDate date,

    Amt numeric(9,2)

    )

    set...

  • RE: Query Help - Embed a \ string in a string

    Sean Grebey (8/6/2013)


    I'm trying to modify an existing stored proc. This seems like of like a weird way to do it, but based on input parameters they are basically constructing...

  • RE: Export/Import query

    This does look difficult to explain with words. Using ddl this probably would be a lot simpler. Ultimately you need some help putting together a query which means that somebody...

  • RE: Execute a function from a query

    krypto69 (8/6/2013)


    If I do this it works..

    insert into Vendors

    SELECT * FROM dbo.itfAPVEND()

    Thanks for your help Sean!

    Glad you got it working. I must have been typing my last response when you...

  • RE: Execute a function from a query

    Sean Lange (8/6/2013)


    select * from dbo.itfAPVEND()

    Be careful here though. You have a table valued function but it is a multi-statement function. The performance can end up even worse than scalar...

  • RE: Execute a function from a query

    select * from dbo.itfAPVEND()

    Be careful here though. You have a table valued function but it is a multi-statement function. The performance can end up even worse than scalar functions.

  • RE: Get last transaction from multiple groups of records

    Lrobinson 93181 (8/6/2013)


    I've gotten a little further

    Step 1 query gets me this:

    c_iD1 c_rep c_Date

    11111 23 ...

  • RE: Export/Import query

    branovuk (8/6/2013)


    One more issue with this specific query, which gave me headache is:

    - db1 has record like this:

    record_id, column1, column2, column3, column4.

    - db2 has record like this:

    record_id, column_id (based...

  • RE: Export/Import query

    branovuk (8/6/2013)


    Hello all,

    I have two databases, db1 and db2.

    I am pulling data from db1 with view which I have to insert in db2 table:

    - if record in db2 with same...

  • RE: Pass inter year and month return last day of month

    Here is another method.

    DECLARE @y int = 2012, @m int = 7

    select DATEADD(day, -1, dateadd(mm, datediff(mm, 0, cast(@m as varchar(2)) + '/01/' + cast(@y as char(4))) + 1, 0))

  • RE: Get last transaction from multiple groups of records

    OK trying once again to piece this together.

    Step #1 is easy enough. I think we got that. Your description of Step #2 doesn't make sense here.

    2. Nest the first...

  • RE: Search Updates - Aug 6, 2013

    That is excellent!!! I know that I was at least one of the people who has requested including the author. That in combination with release date and sorting makes the...

  • RE: Plugging in a variable column name in a stored procedure

    Annee (8/6/2013)


    But the query you wrote is not working because the output sql looks something like:

    select count (*) from table where clientName = @clientName....

    which is actually supposed to be

    select count...

  • RE: Plugging in a variable column name in a stored procedure

    Annee (8/6/2013)


    Thanks for the quick response and the solution, had to modify it slightly as below:

    CREATE PROCEDURE [dbo].[pr_GetVendorInfo]

    (

    @ClientName nVarChar(15),

    @VendorName nVarChar(40),

    @InvoiceType nVarChar(30)

    )

    AS

    declare @sql nvarchar(2000)

    set @sql = 'SELECT COUNT(*) FROM AgencySupplierPartner '

    ...

Viewing 15 posts - 7,246 through 7,260 (of 15,381 total)