Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 3,957 total)

  • RE: Help with Query

    Here's another suggestion:

    WITH Table1 (ID, Val) AS

    (

    SELECT 201220, 0.5

    UNION ALL SELECT 201219, 0.4

    UNION ALL SELECT 201218, 0.4

    )

    ...

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (12/16/2013)


    I don't mind too much snow here, prefer it in the mountains.

    It snowed last week, still snow on the ground, but supposed to hit 60F...

  • RE: Time issues

    Are you perhaps looking for something like this?

    WITH SampleData (Times, ACD, Other) AS

    (

    SELECT CAST('08:30' AS DATETIME), -12, -10

    UNION ALL SELECT CAST('09:00' AS DATETIME), -48, -0

    UNION ALL SELECT...

  • RE: Table join / pivoting question

    It appears that Monday morning without coffee isn't particularly conduciveto understanding requirements, so post removed.

  • RE: query Help

    pietlinden (12/12/2013)


    Your table is really structured like that? What happens if you get more software packages? Does the table structure change? IF y

    I think storing information using this...

  • RE: Data Dictionary

    Perhaps it is just a recommendation:

    We recommend that you use catalog views because they are the most general interface to the catalog metadata and provide the most efficient way to...

  • RE: Data Dictionary

    happycat59 (12/12/2013)


    dwain.c (12/12/2013)


    jshahan (12/12/2013)


    You can also query information_schema.columns.

    select * from information_schema.columns where table_name = 'YourTableName'

    Better to use sys.columns or sys.all_columns as information_schema.columns is being deprecated.

    All the technical metadata exists in...

  • RE: Data Dictionary

    jshahan (12/12/2013)


    You can also query information_schema.columns.

    select * from information_schema.columns where table_name = 'YourTableName'

    Better to use sys.columns or sys.all_columns as information_schema.columns is being deprecated.

    All the technical metadata exists in there. ...

  • RE: sql query to find the difference in values from previous month

    John Mitchell-245523 (12/12/2013)


    Have you looked at the new LAG and LEAD windowing functions?

    John

    I agree with John that LAG would be pretty good for this:

    WITH Aggregates AS

    (

    SELECT...

  • RE: Median or Average function for char(10) = '0-5'

    You might want to take a look at this article:

    Condensing a Delimited List of Integers in SQL Server[/url]

    Somewhere buried deep into it (perhaps 2/3s of the way down if I...

  • RE: Must Declare the scaler variable @mesg_out

    I have to agree with earlier posters that you don't need dynamic SQL for this, but let's assume that we can't see everything you do and it is really needed...

  • RE: Convert BigInt to seconds or milli-seconds or nano-seconds

    Is this what you're looking for?

    WITH SampleData (dur_nano) AS

    (

    SELECT CAST(163691964 AS BIGINT)

    )

    SELECT dur_nano

    ,millseconds=(dur_nano/1000000)

    ,microseconds=(dur_nano/1000)%1000

    ,nanonseconds=dur_nano%1000

    FROM SampleData;...

  • RE: Performance Opinion

    You should wrap your UPDATEs/INSERT/MERGE in a TRANSACTION and then do COMMIT/ROLLBACK consistent with your error handling.

  • RE: Insert dates into table in the giving range.

    Or you can skip creating the table all together and use a calendar generating FUNCTION instead:

    CREATE FUNCTION [dbo].[GenerateCalendar]

    (

    ...

  • RE: Set based super challenge

    ChrisM@Work (12/12/2013)


    -- I might give it a go over lunch.

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

    I can see it now. Cornish pasty in one hand while the other furiously types in the 1M row test...

Viewing 15 posts - 1,006 through 1,020 (of 3,957 total)