Forum Replies Created

Viewing 15 posts - 571 through 585 (of 683 total)

  • RE: String Parsing UDF

    No worries

    I've extended the code to deal with different separators and I've tweaked it slightly. If you want to make specific replacements at...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: String Parsing UDF

    Hi Charlotte,

    This works for all your examples. Just run it and see what you think...

    --Input examples

    DECLARE @v-2 VARCHAR(100)

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Flatten a table

    And thanks for the feedback

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: AutoSorting

    Hi Elizabeth,

    This should give you some ideas and get you started...

    --prepare and show example data

    declare @project table (id smallint...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Which is Stmt Faster ? ''''BETWEEN'''' or '''' =''''

    I'm pretty sure there's no difference whatsoever speed-wise - they will be interpreted in exactly the same way. I prefer between from a readability point of view, but that's just my preference...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Help (Date)

    Hi Najeeb,

    Chillino is right - using a 'numbers' table makes this problem very easy to solve. Here's one way you can achieve what you need. Just run it to see......

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Extracting the DDL for a table

    Hi all,

    My post doesn't answer Lowell's problem (sorry Lowell! ), but here's a related article I wrote a few years ago...

    http://www.sqlservercentral.com/columnists/rrandall/creatingascriptfromastoredprocedure.asp

    The title was originally "Creating...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Need 1st and Last day of LAST QUARTER

    Hi Bill,

    Aren't you almost there once you've got the first day of this qtr (as you have). Just take off 3 months for a) and 3...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: order query joins to first order detail

    Something like this...

    declare @orders table (orderid int)

    insert @orders

              select 1

    union all select 2

    union all select 3

    declare @orderDetails...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Query

    Something like this?

    declare @t table (RowId int, BCode varchar(4), dt_O datetime, dt_Cl datetime, Type char(1))

    insert @t

              select 1, '0001', '1/1/6', '1/2/6', 'C'

    union all select...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Line Breaks in Stored Procedure

    You might want tor try using both carriage return and line feed...

    CHAR(13) + CHAR(10)

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Table Design Question

    I agree!

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Generating Permutations in T-SQL

    Hi all,

    I wrote this for fun, and thought I'd share it here, since it's vaguely related. It's interesting mathematics (in that the method works) if nothing else.

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: Inverse -- Reverse

    Is there a reason why you can't just use substring? Like this...

    --This SQL script is safe to run

    DECLARE @t TABLE (Id INT IDENTITY, Name_Id...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • RE: saving on a permanent table

    From BOL:

    Inserting Rows Using SELECT INTO

    The SELECT INTO statement creates a new table and populates it with the result set of the SELECT. The structure of the new...

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • Viewing 15 posts - 571 through 585 (of 683 total)