Forum Replies Created

Viewing 15 posts - 7,951 through 7,965 (of 8,731 total)

  • RE: Retrieve the TOP 10 Elapsed time (query)

    Thank you for completing the information Erland. I just gave a starting point but as you've said, there's a long way to go from there (unless the OP takes the...

  • RE: Can a strawberry query be done better?

    Depending on the requirements, you might want to use RANK instead of ROW_NUMBER if you need to bring up ties instead of a single best.

  • RE: Retrieve the TOP 10 Elapsed time (query)

    Unless you store all the queries that run on your server (or at least the more expensive), there's no way you can obtain them from a script.

    However, you can use...

  • RE: Turn rows into columns

    You might want to read these articles.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]

    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs[/url]

  • RE: DATABASE SLOW

    You might want to take a look at this book if you're going to take care of the database

    Troubleshooting SQL Server: A Guide for the Accidental DBA[/url]

  • RE: How to import non-delimited text file

    You're right Ed, I called it a dummy table and you called it inbox table but we're referring to the same thing. There's not much difference on our methods, it's...

  • RE: Query help

    You can use a CASE statement.

    SELECT q.Course_Code, CASE WHEN res.[4a] = 0 THEN 0 ELSE 6-res.[4a] END as [4a],

    ...

  • RE: Partial match & Update

    I'm with Lowell on cleaning up the data.

    However, this might help you, but you still have to review the matches given.

    ;With Table1([AppID],[Appname])

    AS

    (

    SELECT 'Null','CSO Services Operations' UNION ALL

    SELECT 'Null','CSP' UNION ALL

    SELECT...

  • RE: How to import non-delimited text file

    Here's an idea, you might have to work on it.

    First, insert into a dummy table with an identity column and a varchar column (the length might depend on your file....

  • RE: Implicit conversion using COALESCE or CASE

    COALESCE will do an implicit conversion using Data Type Precedence.

    The convertion from COALESCE to CASE is just the way COALESCE works (at least a part of it).

    For more information on...

  • RE: split a string

    Something like this?

    DECLARE @fullstreet varchar(50) ='100 NW 25 St APT# 303'

    SELECT LEFT( @fullstreet, PATINDEX('%APT%', @fullstreet)),

    REPLACE( RIGHT( @fullstreet, 1 + LEN( @fullstreet) - PATINDEX('%APT%', @fullstreet)), 'APT# ', 'Apartment = #')

    Depends...

  • RE: help with sp_MsForEachDb

    I wonder if you're missing the quote marks or if it was a copy/paste error.

    EXEC master.sys.sp_MSforeachdb

    N'INSERT INTO Dba_admin.dbo.databaseDataFileSize

    SELECT ''?'', SUM(size) * 8, cast(getdate() as date), cast(getdate() as time)...

  • RE: CHARINDEX problem

    What are you trying to do? It seems to me that you want either one of these options.

    Without sample data and expected results there's hard to know.

    Select LEFT(FT.DESCAR,CHARINDEX('|',FT.DESCAR)-1) from FT

    where...

  • RE: Dynamic Vertical Rows to Horizontal

    TMP_URE is the name that you supplied in your code. I assumed that was your table. You should change it for the dynamic code to run.

  • RE: Dynamic Vertical Rows to Horizontal

    I'm not sure if I can be of great help. My problem is that I can't see what you see.

    I gave you a link to an article that explains very...

Viewing 15 posts - 7,951 through 7,965 (of 8,731 total)