Forum Replies Created

Viewing 15 posts - 1,891 through 1,905 (of 1,957 total)

  • RE: FizzBuzz

    I have posted a solution on ASK that does the COUNT_BIG select for 4 Billion rows in 16 minutes on SQL express on my laptop, while I am working in...

  • RE: Weird Rounding

    Another approach I sometimes use is to compare like this:

    SELECT ....

    WHERE ABS(float_1 - float_2)>=0.01

    Changing the 0.01 to whatever value you consider to be a variance.

  • RE: Avoid dynamic SQL

    grnlt (3/1/2010)


    but if you are using SSRS and the report is needing to pull data from up to the minute time, isnt dynamic SQL the only way to go?

    No, there...

  • RE: Weird Rounding

    FLOAT is an imprecise data type...

    try this:

    declare @val float

    select @val=49.395

    select @val,convert(decimal(38,28),@val)

    and notice that @val does not exactly equal 49.395

    then try

    select convert(decimal(38,28),TotValue) as...

  • RE: Avoid dynamic SQL

    Agreed, the WHERE clause can combine both, but also you can do away with the @Account_Or_Group variable and associated lookup code.

    You said the two lookups are mutually exclusive, so there...

  • RE: Help- Very Complex SQL query

    For those interested, here's the proper way to write the code following "my" best practices...

    UPDATE dbo.TableA

    SET SomeColumn = b.SomeOtherColumn

    FROM dbo.TableA ...

  • RE: open database

    Hi,

    Did you try the code I posted?

    You said the gridview worked using the connection string in web.config, so there is no problem with authentication, but there is a problem with...

  • RE: Orphaned SQL login in replicated db

    I don't know if it applies to replication, but check out sp_change_users_login

  • RE: open database

    Dim _cnString as string = ConfigurationManager.ConnectionStrings("VanillaConnectionString").ConnectionString

    Dim cn As New SqlConnection(_cnString)

  • RE: Use dynamic Pivot table as part of another query

    Luckbox72 (2/12/2010)


    I tried

    SET @query=

    'SELECT * Into #tempTable FROM

    (SELECT RepID, State

    FROM RepBDState) src

    PIVOT (count(State) FOR State IN ('+@listCol+')) AS pvt'

    EXECUTE (@Query)

    select * from #tempTable

    and when run I get the following

    (236...

  • RE: Dynamic SQL in creating columns and summary

    Would you mind giving a more detailed explanation including a sample scenario to show the point where dynamic SQL start not to work anymore?

    I meant "up to a point" as...

  • RE: How to create a view dynamically thru a procedure

    You can't use GO in a dynamic query like this.

  • RE: Error Converting Data Type varchar to float

    I guess you have variable "types" of data in DataValue - hence the check for DataCode=9 ?

    In which case you will need to make SQL filter by DataCode before it...

  • RE: Dynamic SQL in creating columns and summary

    [previous post appeared while I was writing this one - this can be taken as an addendum to that]

    If you really want that sort of information, just extract the data...

  • RE: Sigh ... weird issue

    Your field SARatio is a percentage held as a number between 0 and 1?

    Try ...

    WHERE ABS(SARatio - 1)>=0.01

    just to see if you are getting the line selected due to it...

Viewing 15 posts - 1,891 through 1,905 (of 1,957 total)