Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 1,109 total)

  • RE: Object Definition for Foreign Key

    Michaela's solution is good, but I'd like to add one thing to it. When you disable a constraint with "NOCHECK" it will do two things. It will disable it, and...

  • RE: can we create a synonym for a symmetric key

    Synonyms can only be created for tables, views, functions, stored procedures and extended stored procedures. (And there are some limitations even for these.)

    Regards,

    Andras

  • RE: Transpose columns to Rows ( Without any function)

    Just to add to my solution: It works on SQL Server 2005 only. You can read more about pivot and unpivot on

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/24ba54fc-98f7-4d35-8881-b5158aac1d66.htm

    Andras

  • RE: Transpose columns to Rows ( Without any function)

    Hi Karthik,

    UNPIVOT can do what you need. The query would look like:

    SELECT PropertyID, data

    FROM ( SELECT

    CONVERT(FLOAT,SUM(ParAmt)) ParAmt

    ...

  • RE: Documenting EVERYTHING

    Have a look at SQL Doc from Red Gate (disclaimer: I work for them).

    Regards,

    Andras

  • RE: Help with Correlated Subquery

    Peter's solution is indeed impressive. It does seem to be faster, and unlike the CLR solution, but like the user defined function, it allows ordering the items that are to...

  • RE: Select data as columns

    SELECT [Length]

    , [Width]

    , [Thickness]

    FROM ( SELECT ItemID

    ...

  • RE: Getting ''''view'''' data to external application(s) from SQL2005

    This is not a simple thing to do If you want to know what a user is currently accessing in the user interface...

  • RE: Transaction Logs - unrestricted?

    There is not really an oldest transaction log. Transaction logs are on a per database basis. A database may have several transaction logs (in which case all of them are...

  • RE: Physical File Placement

    As always the answer is: it depends

    For your tempdb, if it is not write intenisve, then RAID 5, if it is write intensive...

  • RE: Physical File Placement

    Another thing to add to Alexander Chigrik's article is that SQL Server 2005 is puts a larger load on tempdb than 2000.

    Regards,

    Andras

  • RE: Best way to shrink a log file?

    Joe is right about the truncation being useless if you do not back up the transaction log and are running in full or bulk recovery mode. Before running shrink file,...

  • RE: calculating average age

    Of course if one wants to use AVG(FLOOR, the query can be simplified to:

    DECLARE @today datetime

    SELECT @today = GETDATE()

    SELECT AVG(DATEDIFF(year, dob, @today)) from ages

    WHERE dob IS NOT NULL

    (and I'm getting...

  • RE: calculating average age

    It depends on what you would like to count

    AVG(FLOOR will give you the average of ages expressed in years, so if someone is...

  • RE: calculating average age

    DECLARE @today datetime

    SELECT @today = GETDATE()

    SELECT AVG(FLOOR(DATEDIFF(day, dob, @today) / 365.2425)) FROM ages

    WHERE dob IS NOT NULL

    (assuming that the table is called "ages", and the column with the date of...

Viewing 15 posts - 1,066 through 1,080 (of 1,109 total)