Forum Replies Created

Viewing 15 posts - 1,606 through 1,620 (of 2,007 total)

  • RE: Temp table vs Table variable

    GilaMonster (8/8/2011)


    skcadavre (8/8/2011)


    "Table variables are not the same as temporary tables. The biggest differences are that: -

    •Temporary tables can be altered with DDL statements whereas table variables cannot.

    Essentially, this...

  • RE: Temp table vs Table variable

    pkasemsant (8/8/2011)


    As developer and still got lots to learn in SQL Server administration, can anyone tell me, which is better using temp table(s) or creating table variable(s) within these conditions,

    i....

  • RE: LOG AUTOGROWTH

    It depends on what the activity is like.

  • RE: How to convert this 'dd-mm-yyyy' to 'yyyy-MM-ddTHH:mm:ss.fff' string format?

    Not sure what ".fff" is, but the "T" is ISO8601 -> code 126

    SELECT CONVERT(VARCHAR(100),GETDATE(),126)

  • RE: SQL code issue

    pwalter83 (8/3/2011)


    Welsh Corgi (8/3/2011)


    Do you know what DDL and sample data is?

    No actually my English is not good neither are my SQL skills...I do know what a stored procedure is...

  • RE: SQL code issue

    pwalter83 (8/3/2011)


    John Mitchell-245523 (8/3/2011)


    OK, I think we've come as far as we can without your providing any table DDL and sample data. Please post the former in terms of...

  • RE: simple question

    Without seeing the tables, data, or requirements this is difficult.

    Try this: -

    SELECT *

    FROM (SELECT *

    FROM news

    ...

  • RE: Query Help

    Like this?

    DECLARE @string AS VARCHAR(50)

    SET @string = 'AAAA, pqrstuv, xxxx-lmn, ZZZsswD'

    SELECT '''' + REPLACE(REPLACE(UPPER(@string),' ',''),',',''',''') + ''''

    -Edit-

    Bear in mind that this will not work if there are ever spaces in...

  • RE: how to return zeros with a group by that returns nulls

    Difficult to answer your question with the data you've provided. See the below examples for how to work it out yourself.

    DECLARE @TABLE AS TABLE(The_Group INT)

    INSERT INTO @TABLE

    SELECT 1

    UNION ALL...

  • RE: Issue with NULL or some white space character

    Eric M Russell (6/23/2011)


    Perhaps a user entered some trash for the email address in the web form. When I exec the following, I see several character values that are invisible...

  • RE: Three month Average

    Something like this?

    ;WITH id_CTE AS (

    SELECT name, status, fordate, a,

    ROW_NUMBER() OVER (ORDER BY fordate ASC) AS id

    FROM #data),

    work_CTE AS (

    SELECT name, status, fordate, a, id

    FROM id_CTE

    WHERE id = 1

    UNION ALL

    SELECT...

  • RE: Bug in CTEs?

    --Edit--

    Misread post.

    Very strange behaviour though.

    --Edit 2--

    If you change the AttribValues CTE to contain the clause, it works.

    ,AttribValues

    AS

    (

    SELECT ItemNumber, Item

    ...

  • RE: Displaying week by week(only week days not weekends) between two dates

    --EDIT--

    Have now tested. I've written it to emulate your description rather than your code. If it should be the other way around, let me know. To find out...

  • RE: SQL Query for MI Report

    Just to keep anyone that is interested informed, the final version : -

    DECLARE @starttime DATETIME, @endtime DATETIME, @interval INT

    SET @starttime = '2011-06-13 07:45:00'

    SET @endtime = '2011-06-13 20:30:00'

    --Minutes

    SET @interval = 1

    ;WITH...

  • RE: Rounding Datetime

    D'OH!

    Was being stupid. The answer is this: -

    SELECT DATEADD(MINUTE, DATEDIFF(MINUTE, 0, thedate)/15 * 15, 0)

    FROM @TABLE

Viewing 15 posts - 1,606 through 1,620 (of 2,007 total)