Forum Replies Created

Viewing 15 posts - 49,246 through 49,260 (of 49,552 total)

  • RE: Question of the Day for 09 Jan 2006

    It did mention the version

    Question - Worth 2 Point(s)

    Category : SQL Server 2005 - TSQL

    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: Question of the Day for 09 Jan 2006

    You did try it on sql 2005?

    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: Result from 2 tables with no link

    Only if the two tables have the same number of fields with compatable datatypes.

    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: Maths functions on subqueries

    It doesn't compile because of this:

    LEFT OUTER JOIN

      (SELECT COUNT(ID) AS NumberDue

       FROM tblMEMResellerOrders ResOrds

       WHERE (resords.Expiration <= '12/30/2005 23:59:59')

        AND (resords.Expiration >= '12/1/2005 00:00:00')

        AND (resords.PurchaseOption <>...

    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: Maths functions on subqueries

    Impossible to test without table schemas and example data, but this should give you somewhere to start.

    I moved the subqueries into the from clause so that the values returned...

    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: Need help in extracting data

    Firstly, I would suggest a table redesign, if that's possble.

    EmployeeSkills would be much, much better as below.

    CREATE TABLE EmployeeSkillset (

     EmpID CHAR(8) NOT NULL,

     SkillID INT NOT NULL,

     IsPrimarySkill BIT NOT NULL...

    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: execute DTS packages

    JV: check the account that SQL Agent runs as. Make sure it has permission to access the file. Make sure you use full paths, not relative paths

    Regarding permissions for...

    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: execute DTS packages

    Just bear a few security issues in mind. A fairly high priviledged account is required to use xp_cmdshell. Check Books online for the exact details

    Commands run from xp_cmdshell run 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: Sort By Date??

    Um, her test, actually

    I didn't think of the subquery, thanks for that idea.

    I was...

    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: Sort By Date??

    Won't work. I had a similar issue the other day. Once you've created a column alias with the same name as a column in the table there's no way (that...

    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: execute DTS packages

    why would you want to call a DTS package in a trigger? Trigger code should be as short as possible and do as little as possible.

    What are you trying to...

    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: Result from 2 tables with no link

    Select TableA.Col1 FROM TableA WHERE TableA.ID = 1;

    Select TableB.ColA FROM Table B WHERE TableB.ID = 2

    Put that as the commandtext for your .net SQLCommand. It will return 2 recordsets.

    That, or write...

    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: Question of the Day for 03 Jan 2006

    EXECUTE AS LOGIN = 'TestDomain\TestUser'

     -- run testing code here

    REVERT

    You need impersonate rights on the login that you're impersonating.

    See ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/613b8271-7f7d-4378-b7a2-5a7698551dbd.htm in the SQL 2005 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: Data Value

    A varchar will store spaces if they're part of the string that's put in the variable/field. It just won't pad with spaces to full length like char does.

    Note that LEN...

    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: stored procedure question

    And for dynamic sorts...

    CREATE PROCEDURE SortedPerson

     @SortField VARCHAR(30) = 'Surname'

    AS

    SELECT title, first_name, surname

     FROM Person

     ORDER BY CASE @SortField WHEN 'First_Name' THEN first_name

      WHEN 'Title' THEN title

      ELSE Surname

     END

    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 - 49,246 through 49,260 (of 49,552 total)