Forum Replies Created

Viewing 15 posts - 1 through 15 (of 24 total)

  • RE: Collation question

    Another solution could be to use a table object instead of a temporary table.

    It looks like their default collation is the database collation.

    In my example :

    DECLARE @TempCollation TABLE (Field1 nvarchar(50)...

  • RE: Collation question

    Why would other databases prevent you from changing the server's default collation ?? Those other databases will still keep whatever collation they already have.

    Yes! they will, but what...

  • RE: Collation question

    Ian and PSA

    I think you are missing the point here...or am I 🙂

    If your database and temDB collation differ you have to either rebuild the masterDB or create your temptables...

  • RE: Collation question

    Patrick Duflot (3/17/2008)


    CREATE PROCEDURE [dbo].[TestCollation]

    AS

    BEGIN

    CREATE TABLE #TempCollation (

    Field1 nvarchar(50) NOT NULL)

    INSERT INTO #TempCollation

    SELECT Field1 FROM Table1

    SELECT Field1 FROM #TempCollation

    UNION

    SELECT Field1 FROM Table1

    END

    Try to change your CREATE TABLE clause to...

    CREATE TABLE...

  • RE: Not sure of best way to select different status values

    Adam Haines (2/20/2008)


    ...Jonnie for performance reason we should not use the in clause. Since your function is returning a table the option for best performance is to do an...

  • RE: Not sure of best way to select different status values

    meichner (2/20/2008)


    I am new to this XML query stuff so please forgive the question. I have tried to get your function to complile, but I keep getting errors about an...

  • RE: Not sure of best way to select different status values

    meichner (2/19/2008)


    At this point I am not sure if I am better off using dynamic sql or using optional parameters in my t-sql script. Any thoughts?

    Thanks

    You should not use...

  • RE: Collation problem

    Maybe it's too much work to change your queries but one option is to create your temp tables first...

    --if you do like this...

    Select name into #tmp from Person

    --you can change...

  • RE: Narrow down the recordset

    Jonnie Pettersson (2/13/2008)


    Now I'm lost 😉

    if you implemented this...

    AND Con.Periodenddate <= (SELECT TOP 1 PeriodEndDate FROM

    (SELECT TOP 2 ConsultantID, AchieveLevel,

    ...

  • RE: Narrow down the recordset

    Now I'm lost 😉

    if you implemented this...

    AND Con.Periodenddate <= (SELECT TOP 1 PeriodEndDate FROM

    (SELECT TOP 2 ConsultantID, AchieveLevel,

    Max(PeriodEndDate) AS...

  • RE: Narrow down the recordset

    Hmm, I'm not sure what you are doing in the main sproc but as I see it, you have to left join with more columns...

    LEFT Outer JOIN #Temp r ON...

  • RE: Narrow down the recordset

    alorenzini (2/13/2008)


    .... repromote in #Temp that if it is a CurrentLevel to suppress the 'X' in the Repflag column.

    Have you tried the code in my earlier post? Didn't it work?

  • RE: IN Operator Using Table Function Not Working

    Not much info but... http://support.microsoft.com/default.aspx/kb/235340

    Quoted from Microsoft

    "The SQL Server OLEDB provider (SQLOLEDB) has a new behavior designed to provide more accurate information to the caller about what happened...

  • RE: IN Operator Using Table Function Not Working

    Insert...

    SET NOCOUNT ON

    after the AS clause in your stored procedure (in the beginning)...

    A recordset can contain meny recordsets...and your subquery will be the first recordset and the data...

  • RE: Narrow down the recordset

    Adam Haines (2/12/2008)


    Not quite, if the repromote is the currentlevel then don't display. The script works but it is still not suppressing the repromote is at the current level.

    --if the...

Viewing 15 posts - 1 through 15 (of 24 total)