Forum Replies Created

Viewing 15 posts - 511 through 525 (of 1,409 total)

  • RE: Syntax advise please

    twin.devil (3/4/2014)


    its failing on the join condition .... your other table have a data type of float.

    you with ensure that data on which you are joining should be of numeric...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Syntax advise please

    Keep in mind there are some caveats with the IsNumeric function. Several blogs and articles are written about that. Search for "IsNumeric" on this site.

    Take a look at http://www.sqlservercentral.com/articles/ISNUMERIC()/71512/

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Syntax advise please

    igloo21 (3/4/2014)


    Above bolded parts in the quotes display a contradiction. Did the query run correct when removing both the CASE statements or did it NOT run correct?

    If it didn't run...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Syntax advise please

    igloo21 (3/4/2014)


    GilaMonster (3/4/2014)


    If you comment out the CASE in both the select and the where does the error go away?

    Thanks for the reply, yes it goes away, but I need...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Syntax advise please

    What is the defined datatype for column [sCustomer_number] in table [dbo].[abc_Customers] ?

    I expect the error is caused by the CASE statement. Can you confirm this by removing both the CASE...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: CASE usage

    Kurt W. Zimmerman (2/28/2014)


    This logic your ELSE will never get hit because A will be either 0 or not 0. I think you want when a=0... when a=1.... else...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: How to find a SSMS instance consuming the most of memory?

    I see your point although you can also colorcode the query-windows in SSMS. Register the instances in registered servers and apply a different color for each instance under the "connection...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: CASE usage

    If you want the option to have 'XXXXX' as a complete textstring instead of this added after the intial string, then you need to put the initial string inside the...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: How to find a SSMS instance consuming the most of memory?

    Wouldn't it be easier to open connections to multiple SQL instances from one single SSMS? Each SSMS will need it's own resources, so opening up only one SSMS will perform...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: getting mismatched data instead of having same data

    The problem is in the rounding of FLOAT values. A FLOAT value isn't a precise value.

    You can see the difference where you substract the values, see the results from the...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Query help

    The EXEC (@SQL) starts a new transaction. Within this transaction the variable has to be declared.

    declare @var varchar(max) = '@var1',

    @sql varchar(max)

    declare @var1 varchar(max)

    print @var

    set @sql='declare '+@var+' varchar(max);set '+@var+' = ''name'''

    print...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: How do I write query and group by the quarter of datetime field

    With your provided sample data the blelow query will get the desired results.

    Query:

    select

    COUNT(ID) as 'Count'

    , CONVERT(char(4), datepart(yyyy, CreatedOn)) + 'Q' + convert(char(1), datepart(q, CreatedOn)) as QuarterOfYear

    , State

    from Ticket

    group by

    CONVERT(char(4), datepart(yyyy,...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: How do I write query and group by the quarter of datetime field

    You can use the DATEPART function to get the quarter of a datetime value. Next you need to GROUP BY on the DATEPART part. Below I have generated some sample...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: SQL Agent Job not finishing

    Casper101 (2/10/2014)


    Hi,

    ...it has happened that the job does not finish and at 8 AM when business opens it then causes loads of problems with deadlocks, forcing me to Kill the...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: User mapping script

    Does it succeed if you add this user to the 'db_owner' role using SSMS? First try scripting out your actions in the GUI and run the output. If that doesn't...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 15 posts - 511 through 525 (of 1,409 total)