Forum Replies Created

Viewing 15 posts - 406 through 420 (of 595 total)

  • RE: SQL server does not exist or access denied

    I have run into this error before due to expired trial versions. Strangely, the error does not mention expired trial version, until you go into the Event Viewer and...

  • RE: passing multiple values to stored procedures

    Options:

    1) You can pass a delimited string as a single and split the string in the procedure, building a dynamic SQL statement and then executing.

    2) Or you could create...

  • RE: Converting a char to a smalldatetime

    Good point, Ian. A more locale-independent version of my previous post would be:

    declare @input varchar(8)

    declare @date1 varchar(12)

    declare @date2 datetime

    select @input = '01012003'

    select @date1 = substring(@input, 5, 4) + substring(@input,...

  • RE: Converting a char to a smalldatetime

    I think if '01012003' is the format of the string coming in to the proc, you will have to add some sort of delimiter to the string in order for...

  • RE: joining 2 queries

    In your third (combined) query, it doesn't look like you are JOINING correctly. You have 2 ON expressions one right after the other. Try this:

     
  • RE: Case statement in where clause

    A couple notes:

    I know you prefer not to use the UNION ALL approach, but I would be willing to wager that the query plan generated for an identical query using...

  • RE: Case statement in where clause

    quote:


    ...Again, is there any particular reason a case statement incapable of return a boolean value? Why can't we say:

    cond1 and case .......

  • RE: Case statement in where clause

    
    
    SELECT AssetFields
    FROM Asset
    WHERE OrderType <> 'TFW'
    AND AssetTypeDesc IN ('RGNEW', 'RGREF', 'dsad' ,'dada', 'dsada')
    UNION ALL
    SELECT AssetFields
    FROM Asset
    WHERE OrderType = 'TFW'
    AND RegionCode = 0
    AND AssetTypeDesc in...
  • RE: Case statement in where clause

    quote:


    ...T-SQL is just a lame language. I don't even have a iif function.

    ...


    OK, for a...

  • RE: help need

    I am assuming you are attempting to write a search criteria sort of query. I would recommend breaking into modular queries, with sets of stored procedures that handle each...

  • RE: Top 20 and sum of the others

    You could try:

    
    
    SELECT ISNULL(dt.LoginName, 'Rest of Group') , SUM(m.[CPU]) as SUM_CPU_M
    FROM [master].[dbo].[proc_use] m
    LEFT JOIN
    (
    SELECT top 20 [LoginName], sum([CPU]) as SUM_CPU
    FROM [master].[dbo].[proc_use]
    GROUP BY [LoginName]
    ORDER BY m.SUM_CPU...
  • RE: Search for a specific character length

    quote:


    If the table is very large, and speed becomes a problem, you might want to add a BARCODE_LEN field to the table,...

  • RE: VERY slow running cursor

    It looks like you are not selecting into all your first cursor variables when you find records in the second cursor. The variables @patkey, @dts, @index, and @i will...

  • RE: Am I crazy?

    quote:


    or

    select site_id,site_name,hardware_type,serial_number

    from hardware

    group by site_id,site_name,hardware_type,serial_number

    having count(*) > 1


    This will just identify duplicate records. This...

  • RE: User Define Function error

    I think the first step would be to identify the offending line of code within the function, and run it directly in the SELECT statement against the same subset of...

Viewing 15 posts - 406 through 420 (of 595 total)