Forum Replies Created

Viewing 15 posts - 13,321 through 13,335 (of 13,838 total)

  • RE: how to tweak indexes?

    Watch out for the possibility that INSERT statements can add a row that has its clustered index value 'between' existing entries - possibly forcing a major rewrite of data on...

  • RE: Function for YTD calc in TSQL

    Hi Ray, just a quick comment on your response - your final query will, in fact, only return those orders that are placed at the same millisecond as the query...

  • RE: need Help in select query

    I would have thought that the GROUP BY clause would ensure that city5 would not be displayed 3 times - ** please test and post the results along with the...

  • RE: need Help in select query

    I'm having a bit of trouble working out what you want.  Is it something like this?

    select t1.city, t1.name, sum(no_of_games)

    from test1 t1

    join test2 t2 on t1.city = t2.city

    join test3...

  • RE: Reflexive Relationship

    By "reflexive", do you mean a self-join? If so, I agree with Phill Cart's response - just add the table again and Access will create an alias for it.

  • RE: Reflexive Relationship

    There is - use the SQL pane and write the query yourself.  Is that what you mean?

  • RE: Restoring Database with help of data files

    It is possible to restore without the log file - SQL Server should create a new log for you.  Are you working in EM or QA and exactly what is...

  • RE: SQL QUERY HELP!!! PLEASE!

    So you want to display the campaign count for the partner on the same row?  This is untested, but along the right lines - you will see that I have...

  • RE: Returning the length and IDs of recordsets

    Try this:

    SELECT MAX(LEN(isnull(COLUMN1,''))+LEN(isnull(COLUMN2,''))+LEN(isnull(COLUMN3,''))) FROM TABLE1

  • RE: How to work with updating of data

    It's a simple enough matter to put triggers on tables that you want to be able to do this for - to record 'date last updated' and 'updated by' for...

  • RE: Columns to table

    Suggest you import the spreadsheet into SQL Server "as is" and then normalise.  Your general approach should work though:

    insert into tblNormalised(date, offer, receipt)

    select date1, offer1, receipt1 from imported union

    select date2,...

  • RE: Looking for speed - streamlining procedure

    Surely the time difference here is due to the fact that SELECT INTO is writing to disk and SELECT is not?  How much data are we talking about?

  • RE: Changing Databases within a query

    You need to switch context as part of the sp_executesql statement.  Try this:

    declare @strSQL nvarchar(1000)

    set @strSQL = N'use tempdb '

    set @strSQL = @strSQL + N'select top 10 * from information_schema.columns'

    exec...

  • RE: Compare two tables and return unique data?

    Noticed that col_Fname is ambiguous, so you need to qualify it:

    SELECT DISTINCT r.col_Fname

    FROM tbl_Reports r left join tbl_Employees e

    ON r.col_Fname = e.col_Fname

    WHERE e.col_Fname is null

    If that doesn't work, there's something you're...

  • RE: Compare two tables and return unique data?

    Or this way:

    SELECT DISTINCT col_Fname

    FROM tbl_Reports r left join tbl_Employees e

    ON r.col_Fname = e.col_Fname

    WHERE e.col_Fname is null

    Using != in a join is an advanced technique that will rarely be required.  I...

Viewing 15 posts - 13,321 through 13,335 (of 13,838 total)