Forum Replies Created

Viewing 15 posts - 48,676 through 48,690 (of 49,552 total)

  • 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 =...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Weirdest interview question?

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

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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,'& ',...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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)...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: sql ebook

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

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

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Search for percent signs using like query

    Try

    LIKE '/%' ESCAPE '/'

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: HELP! Logon trigger

    Thanks. I'm planning to put a similar trigger on a couple of my servers. Good to know about the execute as

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Helping hand for beginner

    And don't forget Books Online

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: nvarchar to varchar

    You would see reduced space used, how much depends on the size of the rows and the number of rows in the table. You'll only see the space reclaimed after...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 48,676 through 48,690 (of 49,552 total)