Forum Replies Created

Viewing 15 posts - 301 through 315 (of 683 total)

  • RE: badly written SQL

    It's a little annoying, but you either have to write the whole case statement out again in your where clause, or you have to use a derived table. e.g.

    Ryan Randall

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

  • RE: removing duplicates from a table with no id column or pk

    Here's an article on this subject...

    http://sqlteam.com/item.asp?ItemID=3331

    Ryan Randall

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

  • RE: Insert Statements

    Google is your friend:

    http://www.google.co.uk/search?hl=en&q=create+insert+statements

    Returns a whole heap of good stuff on the first page, including:

    http://www.databasejournal.com/scripts/article.php/1502051

    http://vyaskn.tripod.com/code/generate_inserts.txt

    http://www.codeproject.com/database/InsertGeneratorPack.asp

    Ryan Randall

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

  • RE: User Defined Functions

    Glad to help - thanks for the feedback. It's often the easy things which stump us...

    Ryan Randall

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

  • RE: raise error

    I've just read what Vasc has written, and I agree with that approach. I just wanted some answers first

    A further question is why...

    Ryan Randall

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

  • RE: raise error

    Some questions...

    1. Does this proc compile?

    2. You have a ROLLBACK TRANSACTION but no begin or commit tran? Can you explain?

    3. You are trying to create a table in your sproc?...

    Ryan Randall

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

  • RE: User Defined Functions

    I'm confused. Have you tried this?

    dbo.function(param)

    Ryan Randall

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

  • RE: Converting varchar to a datetime datatype

    But Shabu doesn't want to format data?

    He wants to change the datatype of an existing varchar column to datetime.

    He's got issues with doing that...

    Ryan Randall

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

  • RE: Converting varchar to a datetime datatype

    Okay - that sounds like there's some data in there which is not valid datetime data.

    Try running...

    select dateofbirth from mytable where isdate(dateofbirth) = 0

    If there are some...

    Ryan Randall

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

  • RE: Converting varchar to a datetime datatype

    This works fine for me (the bit in purple is the bit you need)...

    --data

    set nocount on

    create table #t1 (dateofbirth  varchar(30))

    insert #t1

              select '1 jan 2000'

    union all...

    Ryan Randall

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

  • RE: Complex Query

    Or...

    --data

    declare @t table (seq int, area int, page int)

    insert @t

              select 1, 300, 0

    union all select 1, 200, 0

    union all select 1, 100, 0

    union all select...

    Ryan Randall

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

  • RE: update query

    No. That's not possible. You can only update one table at a time unless that table has triggers which update other tables.

    I suspect you just need to do this...

    Ryan Randall

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

  • RE: Character arrays in T-SQL

    But your 'being lazy', Jeff, is most people's 'working my arse off'

    Ryan Randall

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

  • RE: datepart Help

    Ah, yes! I looked in BOL and missed 105

    Thanks Karl

    Cláudia - use that instead of 103 with...

    Ryan Randall

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

  • RE: Character arrays in T-SQL

    Hear, hear!

    Here's a simple example. If you give us the 'bigger picture', we'll be able to show you the best tricks to achieve what you need.

    Ryan Randall

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

  • Viewing 15 posts - 301 through 315 (of 683 total)