Forum Replies Created

Viewing 15 posts - 196 through 210 (of 1,473 total)

  • RE: Date Manipulation with DATEADD/DATEDIFF

    vinaypugalia (4/6/2010)


    Great handy article !!

    However, we can also achieve the same through -

    SELECT CONVERT(DATETIME,DATEDIFF(dd,0,GETDATE()))

    This way we can save the time taken to perform DATEADD operation though it would be...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Date Manipulation with DATEADD/DATEDIFF

    nakache (4/6/2010)


    the fastest way to remove time from datetime is:

    select CONVERT(datetime,floor(convert(float,getdate())))

    Itzik Ben-Gan had a big post on Date Manipulation with benchmarking..(long time ago..)

    I believe this is the article you were...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: T-SQL Oddities

    Tom.Thomson (4/6/2010)


    Garadin (4/6/2010)


    Tom.Thomson (4/6/2010)


    Peter Brinkhaus (3/23/2010)


    Note that variable names @, @@ or names starting with @@ are deprecated in SQL 2008. See http://msdn.microsoft.com/en-us/library/ms143729.aspx:

    Do not use @ or @@ or names...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Cursor - trying to find another method

    I made a very similar one before I re-read it and thought that he needed those numbers to exist in another table. Maybe he does, maybe not.

    DECLARE...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Deleting the columns from the same database through the script

    kunaal desai (4/6/2010)


    Hmmmmmm. can I write a script a script to remove Pk constraint from all th etables in a single database, if the PK column is the same all...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Nice one, please read and give your comments.

    Dave Ballantyne (4/6/2010)


    IMO

    select Date,

    Sum(Case when Type ='Debit' then Amount else 0 end) AS Debit,

    Sum(Case when Type ='Credit' then Amount else 0 end) AS Credit

    From <Table Name>

    Group by Date

    Is...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: T-SQL Oddities

    Tom.Thomson (4/6/2010)


    Peter Brinkhaus (3/23/2010)


    Note that variable names @, @@ or names starting with @@ are deprecated in SQL 2008. See http://msdn.microsoft.com/en-us/library/ms143729.aspx:

    Do not use @ or @@ or names that begin...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: T-SQL Fundamentals ?

    Some of it will carry over. Some of it won't. As much as I love that book, I'd personally recommend getting an Oracle Book instead of reading that...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Are there alternatives to tempdb

    kkapferer (4/5/2010)


    Lowell,

    Thanks for your reply. I reread my original post and I see I was unclear. When I wrote separate instance I was implying that this was a...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Options for dealing with table Contention

    Steve Jones - Editor (4/5/2010)


    If that's the case, you might be surprised what compression does for you.

    I know I like what it does to my DB size. From ~75gb down...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Options for dealing with table Contention

    Steve Jones - Editor (4/5/2010)


    If you can, it would be great for you to capture a workload and then some CPU/mem/disk stats before and after compression. That would make a...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Options for dealing with table Contention

    Steve Jones - Editor (4/5/2010)


    So data compression can help because it substantially lowers I/O. It sounds crazy since it will use more CPU to do the compression, but you end...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Options for dealing with table Contention

    Jeff Moden (4/5/2010)


    Heh... everyone forgot how to eliminate all contention for the table immediately... rename the table. 😛

    Not all contention... there's still the procs that scan for all tables containing...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Removing Blank Fields

    John Dempsey


    I know this was a T-SQL(2K5) forum, but you mentioned you were calling this query in a SSIS package, so I thought I would provide an example of how...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Options for dealing with table Contention

    Edited the original post to include the following information, thanks to everyone for the great ideas suggested here.

    Separate FileGroups on the same Array

    Questionable benefit

    If there is a benefit...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 196 through 210 (of 1,473 total)