Forum Replies Created

Viewing 15 posts - 58,381 through 58,395 (of 59,048 total)

  • RE: Please Help with Strings

    Funny, I just posted a similar solution to remove everything except 0-9...

    If you don't already have a "Tally" table, now's the time to make one... here's the code to make...

  • RE: TSQL - Minimum of numeric value

    Govinn,

    If you don't already have a "Tally" table, now's the time to make one... here's the code to make a Tally table...

    --===== Create and populate a Tally table...

  • RE: Table Creation.

    Yep... for starters...

  • RE: Replace carriage return in ntext(datatype) field

    Steve,

    What is the datatype of the column you are storing this data in?

     

  • RE: Table Creation.

    Just a couple of things...

    If the Inserts will, more or less, be in order by [Date], then having a Clustered Index on date will be OK, otherwise, the Inserts will...

  • RE: Dealing with Apostrophes - char(39)

    Yeah, but, good Lord... don't use a cursor to find and delete dupes (or for anything else for that matter)... here's a fully commented template for deleting dupes... you could...

  • RE: Identity field with characters for Primary Keys

    Ron,

    This is what I posted on the "other" forum you posted the same question on...

    > First, I have to do due diligence... what you're suggesting is, for so many reasons,...

  • RE: How do I go through a table with a timestamp column and determine the accumulated time of certain records

    Bullfrog,

    I'm thinking that your times are a bit screwed up in your example data... they're all 8:23:00.  But, I'm thinking we get the idea...

    The hard part is, I can figure...

  • RE: Timing the Execution of a Stored Procedure

    If you just want duration and not actual CPU seconds used, then something like this works...

    --===== Declare a couple of variables to measure duration

    DECLARE @StartTime DATETIME

    DECLARE @EndTime   DATETIME

  • RE: Creating Pivot Table

    Hi Tushar,

    Look up "cross-tab reports" in Books Online... it has a great example of how to do a "Cross Tab" which some call a "Pivot".  If you want true pivots,...

  • RE: Seek Table Design Advice\Best Practice: Accounting Period

    Absolutely... and that, in fact, your suggestion would definitely be the best way to solve the problem, but someone wanted me to demo using DATEDIFF as both a filter and...

  • RE: Seek Table Design Advice\Best Practice: Accounting Period

    Yep, true enough... I've made the same recommendation to others, myself.  It's a great example of why you need a primary key, though...

    -------------------------------------------------------------------------------------------------------------------------------

      |--Compute Scalar(DEFINE: ([Expr1004]=datename(month,...

  • RE: ISQL

    Try something like this (defaults to tab delimited for Excel)...

    BCP "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" QUERYOUT Authors.xls -c -S"yourservername\instancename" -Uyourusername -Pyourpassword

  • RE: Build Views Dynamically

    John,

    I didn't take the time to convert some of my old code to your specific example but the following code is a good example of a "dynamic crosstab".  Since the...

  • RE: Running a script using "osql"

    You could also embed the OSQL command in a Batch file that could provide instant gratification as to the outcome...

     

Viewing 15 posts - 58,381 through 58,395 (of 59,048 total)