Forum Replies Created

Viewing 15 posts - 91 through 105 (of 211 total)

  • RE: sp_executesql giving truncate error

    Could the error be related to the actual statement sp_executesql is executing?

    Example:

    DECLARE @sql NVARCHAR(MAX)

    SET @sql = 'DECLARE @tbl TABLE (Test CHAR(1))'

    SET @sql = @sql + 'INSERT INTO @tbl VALUES (''ABCD...'')'

    EXEC...

  • RE: ERD Software Needed

    I currently use Quest Toad Data Modeler. I've used ERWin, Visio and Power*Architect in the past. For me I found that Toad does everything I need: reverse engineering right through...

  • RE: Insert into query

    How about if you moved the email criteria to the outer select and added a DISTINCT?

    insert into userprofile(userID, fieldID, value,)

    select distinct userID, 1000, 'external'

    from user

    where not exists (

    ...

  • RE: Insert into query

    Not sure if this'll work or not (base table script and sample data would be helpful) but try adding userID and another set of parenthesis around the ORs in your...

  • RE: Incomplete Dataset when Using Over(Partition By)

    My guess is that the DISTINCT and the aggregate functions aren't playing nice.

    Have you tried it without the DISTINCT and the GROUP BY?

    SELECT

    Account

    , sum(amount) over (partition by account) Total

    , count...

  • RE: Performance Best Practices

    Brandie Tarvin (2/14/2011)


    Because, technically (at least in my environment) even T-SQL is considered code.

    Yep, same here. Most of the heavy lifting is in stored procs (i.e. T-SQL) and is definitely...

  • RE: Performance Best Practices

    Brandie Tarvin (2/9/2011)


    One thing that may help (in the long run) is to come up with a DOs and DON'Ts list (Database standards). If you're cleaning up the code, you...

  • RE: Performance Best Practices

    Thanks for the responses.

    GSquared (2/4/2011)

    First, is review all database code yourself and make sure it's properly tuned, before it goes into production.

    Right call, but tough to implement. Where there used...

  • RE: CASE Function

    Change your string to start with the comma.

    So instead of: 'Tuesday, Wednesday, '

    It would be: ', Tuesday, Wednesday'

    And then you're able to always cutoff the 1st two characters.

    DECLARE @str VARCHAR(50)

    SET...

  • RE: SQL Server Profiler

    lianv 90648 (2/4/2011)


    Good Day,

    is there a way to schedule SQL Server Profiler as a job ?The y need to run on a continuous basis s for auditing . I tested...

  • RE: Naming conventions issue

    I'd have to agree with Grant. Sometimes consistency has to trump logic, especially when you're handing it off to someone else for support.

    Also, if they're going to be inflexible about...

  • RE: Using In Statement in Case Statement

    Seems like there should be a better solution but this seems to work.

    CREATE TABLE #tbl_radio (

    AdDate CHAR(12)

    , AdTime CHAR(8)

    , Station CHAR(4)

    , Duration TINYINT

    )

    INSERT INTO #tbl_radio (AdDate, AdTime, Station, Duration) VALUES...

  • RE: Using In Statement in Case Statement

    Just to be clear, when the first record's time plus the duration (45 sec) is greater than the second record's time then omit the second record?

  • RE: Red-Gate SQL Compare

    Just an FYI: I contacted Red Gate about the 404s and they referred me to documentation on a different release.

    http://www.red-gate.com/supportcenter/Content?p=SQL%20Compare&c=SQL_Compare/help/8.1/SC_CL_Getting_Started.htm&toc=SQL_Compare/help/8.1/toc846144.htm

  • RE: Using In Statement in Case Statement

    Sure, you just need to cleanup the join.

    use

    ...and b.fk_stateid = case when...

    instead of

    ...and b.fk_stateid = b.fk_stateid = case when...

Viewing 15 posts - 91 through 105 (of 211 total)