Forum Replies Created

Viewing 15 posts - 48,691 through 48,705 (of 49,571 total)

  • RE: Incremental INSERT statement

    Or, since we're using SQL 2005, we can use a CTE

    ;

    WITH LotsOfDates(TheDate) AS (

  • RE: PIVOT of varchar alters the value

    Can you post the query please? Table structure and sample data also, if possible.

     

  • RE: Very tough Challenge.....

    Don't post your homework here like that again. Homework is supposed to be for you to do to learn something, not for other people to do for you.

    You learn nothing...

  • RE: Very tough Challenge.....

    Maybe. Won't be the first time.

    I used to do student marking when I was at university. The markers had a habit of doing an internet search for code if...

  • RE: Very tough Challenge.....

    DECLARE @Challenge TABLE (

     RowNo INT IDENTITY

     DesignationName varchar(100)

     Description Varchar(1000)

    )

    DECLARE @LastRow INT, @MiddleRow INT

    INSERT INTO @Challenge (DesidnationName, Description)

    SELECT * FROM tblDesignation

    ORDER BY DesidnationName --(replace with order of your choice here)

    SELECT @LastRow =...

  • RE: Weirdest interview question?

    I had exactly the same question in my last job interview. Really threw me for a few moments

  • RE: TSQL - Inner Join

    This will probably work, but it is not nice. Untested. Give it a try, if it throws errors, let me know

    SELECT tab1.name, min(tab2.company)

     from tab1 inner join tab2 on tab1.id...

  • RE: TSQL - Inner Join

    If you're using 2000, please rather post in the 2000 forums in the future. The row_number function is SQL 2005 only. Since the query was in the 2005 forum, I...

  • RE: Select Statement In Table

    You asked for non-cursor. Try this (untested). If not 100%, should give you a start

    INSERT INTO New_Cust_Table (UserId, Password, SelectStmt)

    SELECT UserID, UserID + '1#', 

     'AND Account Like ''%''' + REPLACE(REPLACE(AccountNo,'& ',...

  • RE: TSQL - Inner Join

    Which two do you want?

    This will get you first 2 alphabetically. I assume you are using SQL 2005.

    SELECT

    Name, Company

  • RE: Anyone see any inefficiencies with this stored proc?

    Hard to tell really without seeing the table and index structure. Your best be would be to run the query in query analyser with the execution plan enabled, and see...

  • RE: Troubleshooting blocking

    Run profiler for a while. When you get the blocking, check the spid and refer back to profiler to find out what the spid did before calling the get_attachment.

    Possible (frightening)...

  • RE: Troubleshooting blocking

    From a quick look, it looks like the sp_get_attachment stored proc is beginning a transaction and not committing or rolling it back. A stored proc should always commit or...

  • RE: What Kind of DBA Are You?

    I'm what most people would call a development dba. I tune indexes, rewrite scripts, monitor performance and suggest better ways of doing things.

    I have a say in the design of...

  • RE: sql ebook

    Books Online (the SQL online help) is extremely good.

    Are you looking for more for info on administration or development?

Viewing 15 posts - 48,691 through 48,705 (of 49,571 total)