Forum Replies Created

Viewing 15 posts - 1,876 through 1,890 (of 2,007 total)

  • RE: cast/convert with no trailing zeroes

    Jeff Moden (7/3/2010)


    Ah... I believe I see... the forum code (or something else) added a spurious CR character. If you get rid of it, the previous code works just...

  • RE: Disable All Triggers

    I try not to use undocumented procedures in anything other than a "one time" thing. I got it right, but personally I wouldn't have done it like that 😉

  • RE: Need to Swap the word in SQL

    Saravanan_tvr (7/1/2010)


    Small changes i done from your query

    SELECT TOP 100 Author,LEFT(author,CHARINDEX(',',author)-1)AS FIRST_PART,

    SUBSTRING(author, CHARINDEX(',',author)+1,LEN(author) ) AS SECOND_PART

    FROM CTBR WHERE Author LIKE '%,%'

    Yes, I was just in the process of writing you...

  • RE: How to sum rows

    Steven, can you please have a look at formatting your data and requested output into something we can read.

    I think your source data should look like this: -

    DECLARE @sourcetable AS...

  • RE: cast/convert with no trailing zeroes

    I agree with Gianluca. But if you insist on doing it in SQL, it can be done like this

    DECLARE @test-2 AS TABLE(

    id INT IDENTITY,

    ...

  • RE: Getting the VARBINARY data into a VARCHAR field

    DECLARE @test AS VARBINARY(MAX)

    SET @test = 0x4858FE25053CA4D236F3D61AE29668BA

    SELECT @test

    ,Substring(( MASTER.dbo.Fn_varbintohexstr(@test) ), 1, 2) +

    Substring(Upper(MASTER.dbo.Fn_varbintohexstr(@test)), 3, 8000)

  • RE: XML query

    I'm still learning SQL, so what I'll show below is definately not the best way to do this :hehe:

    DECLARE @xml AS XML

    SET @xml ='<ITEM RESPONDENT_ID="2" Business_Account_Name="ElectroDom" Category="Director" />'

    DECLARE @pseudoxml VARCHAR(8000)

    SET...

  • RE: XML query

    JoyKing (6/29/2010)


    Xml data:

    <ITEM RESPONDENT_ID="2" Business_Account_Name="ElectroDom" Category="Director" />

    Required Output:

    Respondent_id Business_Account_Name Category

    2 ...

  • RE: Code to convert varchar datatype that contains a numeric expression to a date

    Paul, that's great! I was hoping that when the other thread about this came up one of you gurus would come in and shatter my little code. There's always more...

  • RE: Select Top n Rows and Sum the Values

    wilsot (6/25/2010)


    I've tried running the query:

    SELECT TOP 4 SUM(T_DATA) As Total

    FROM [DataWise].[dbo].[RiverRd_Precip_15]

    That query is doing exactly what you're asking it to 😉

    SELECT SUM(a.t_data)

    FROM (SELECT TOP 4...

  • RE: Help with (probably simple) query

    captcrotch (6/25/2010)


    well thanks for the response skcadavre but the data given is just example data, I need a general query to retrieve data following the logic I gave, whatever is...

  • RE: Help with (probably simple) query

    captcrotch (6/25/2010)


    [font="Courier New"]

    RelationId ProductId DateRelated Xaml

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

    3 lu231342 2010-06-24T16:25:26.643 <Columnist Key="h...

    6 lu231343 2010-06-24T16:35:72.874 NULL

    4 lu231344 2010-06-24T16:29:41.540 NULL

    [/font]

    Why would both 6 and 4 be returned if you want the...

  • RE: "SELECT @local_variable"

    Damn, confused me, went with A,B,C 😛

  • RE: Decimal to datetime

    I'll happily discuss that with the OP if he ever reports back, but I'm fairly certain that the error is in the expected result he posted here rather than in...

  • RE: Stop users using SET LANGUAGE

    I'm no longer at work, so can't do any testing, but. . . can you setup a trigger on "set langauge" then have a case statement that checks the current...

Viewing 15 posts - 1,876 through 1,890 (of 2,007 total)