Forum Replies Created

Viewing 15 posts - 346 through 360 (of 1,082 total)

  • RE: Converting a varchar datatype to hex in a query

    here is an example of sql function that might do the trick:

    SELECT master.dbo.fn_varbintohexstr(459)

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Converting a varchar datatype to hex in a query

    could you give me some data examples please 🙂

    Also have you tried using: hashbytes

    SORRY THIS WILL NOT WORK

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Can I make this any faster

    hi dmw,

    Using an inner join doesn't always give you better performance!!!

    Sometimes using and IN or EXISTS statement in the where clause does cause SQL to use a "Semi Join" which...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: SQL Performance

    If you add the code we might be able to help you 🙂

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: indexing

    has this problem been solved?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Confusing Arithmetic Overflow

    ok sorry I think I worked it out.

    It's because of the return type of the case statement

    The case state is expecting a small date time to be return based on...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Hashbytes function returning unexpected results

    Hi there,

    I'm not sure how Hasbytes works but I went on a hunch and here is my code

    DECLARE @tbl TABLE

    (UserName1 VARCHAR(100),

    UserName2 NVARCHAR(100))

    INSERT INTO @tbl

    SELECT 'avenue','avenue'

    --VARCHAR RESULTS

    select HashBytes('MD5', 'PW4' +...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Confusing Arithmetic Overflow

    could you also let me know what datatype this field is:

    inv.dt_VendorInvoiceDate

    It seems to be from the following table.

    TD_InvoiceDocumentExtension

    That by the looks of things is the only field that...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Confusing Arithmetic Overflow

    what line number of the function is it falling over on ?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: indexing

    By simply changing the query you may not get an improvement, you would need to change the index again.

    If you Could you send me the actual query (e.g what changes...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: indexing

    I'm assuming that you getting an Index seek, with a Key look up or you got a table scan.

    The reason for this is because you are using a select *

    The...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Can I make this any faster

    Here is the function that I normally use for demiliting.

    CREATE FUNCTION dbo.udfStringtoTable

    (

    @String NVARCHAR(100) ,

    @Delimiter CHAR(1)

    )

    RETURNS TABLE

    RETURN (

    SELECT SUBSTRING(@String+@Delimiter, n,

    CHARINDEX(@Delimiter, @String+@Delimiter, n) - n) as [String]

    FROM...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Can I make this any faster

    Could we also see the code for you string to table function.

    I'd think this is a multline table valued function, which is not ideal.

    Perhaps I could turn it into an...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: varchar(8000) being truncated to 4000 when creating a dynamic SQL string

    ok I found a reason.

    You are concatenating Nvarchar values to your string which will change the type of @String.

    Here is a snipet example from your code

    WHILE @key IS NOT NULL...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: varchar(8000) being truncated to 4000 when creating a dynamic SQL string

    I'm sure that the @string is being populated but it's the actualy EXECUTE statement that is doing the truncating.

    If you do a len on your @string you'll see it is...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 346 through 360 (of 1,082 total)