Forum Replies Created

Viewing 15 posts - 511 through 525 (of 600 total)

  • RE: Big Data and SQL

    blandry (9/20/2010)


    How can you write software without some SQL knowledge?

    Even gaming software requires storage, retrieval and use of data!

    But alas... Each time we post ads for new developers, inevitably...

  • RE: Grouping results into range

    Speaking of a prettier way, you can just add sex to the temp table:

    DECLARE @mydata TABLE

    (

    PersonID INT,

    Age INT,

    NationalityID INT,

    Sex char(1)

    )

    INSERT INTO @mydata (PersonID,Age,NationalityID,Sex)

    SELECT 100,5 ,9000,'M' UNION ALL

    SELECT 101,13,1000,'M' UNION ALL

    SELECT...

  • RE: Grouping results into range

    Your problem is that you need a male and female for every range, which basically means even with an outer join to your CTE you cant create the M and...

  • RE: Big Data and SQL

    As someone who first programmed for one small IT group, and now manages a different one, that this is a very important skill.

    There are certainly larger employers out there with...

  • RE: Selecting the max date from view

    It would really help to have DDL so we could test.

    Could you also clarify your requirement? Can the view have multiple records for a given case number?

    For example, if...

  • RE: Query help for distinct

    Here is a solution with a self join. It could probably be tewaked for better performance and I wouldnt be surprised if there's a better way, but it gets...

  • RE: Query help for distinct

    A signature is a setting on someone's forum membership that inserts text at the bottom of all their posts.

    He was linking you to this article: http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • RE: Query help -employee

    What should the output look like? Can you provide a sample table/data and then a sample of what the output would look like?

    Also, just so that I'm clear, you have...

  • RE: ORDER BY not working

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE #pagelist(

    [userID] [int] NULL,

    [pageName] [nvarchar](255) NULL,

    ...

  • RE: ORDER BY not working

    Magy (9/15/2010)


    Oh I see...thanks for BOL link.

    I tried using 101 instead of 103, and I still get a random order by.

    I also just tried doing ORDER BY pageDate, but that...

  • RE: Trim Left and Right

    WayneS (9/3/2010)


    LutzM (9/3/2010)


    WayneS (9/2/2010)


    ...

    Based on this, where the work order ID is the 2nd "field" in this string, I would suggest :

    declare @test-2 varchar(100);

    set @test-2 =...

  • RE: Birthdays in next 7 days

    Here's a fix to Michael's:

    declare @emp table

    (empid int identity(1,1) primary key clustered, dob datetime not null)

    insert into @emp (dob)

    SELECT convert(datetime,'1962-01-01 00:00:00.000') AS dob UNION ALL

    SELECT convert(datetime,'1958-12-31 00:00:00.000') AS dob UNION...

  • RE: Birthdays in next 7 days

    Michael, your code fails when one year rolls over to another

    for example, with the test cases and the presumed current date modified:

    declare @emp table

    (empid int identity(1,1) primary key clustered, dob...

  • RE: Query with column name as parameter

    Saravanan_tvr (9/3/2010)


    Hi In veiw the sq server wont allow to use the declarations,

    Ok, so you've got a function that gives you a delimited list of columns.

    And you want a view...

  • RE: Trim Left and Right

    bpowers (9/2/2010)


    Any idea how I could trim this out to only return the W51247?

    W~W51247~0~1~0

    Can you give us some clearer requirements?

    I mean, substring(@fieldname,3,6) would work for that example, but maybe not...

Viewing 15 posts - 511 through 525 (of 600 total)