Forum Replies Created

Viewing 15 posts - 16 through 30 (of 153 total)

  • RE: storing byte array (byte[] C#) in database

    I looked up reading and writing images to and from the database, because I think the concept would be similar. A nice explanation with some C# code is here:

  • RE: Counting Nulls

    an alternate solution:

    create table #test(PersonID int, [Value] int, Altvalue int)

    Insert INTO #test

    Select 1, null, 6

    union all select 1, null, 6

    union all select 1, null, 6

    union all select 1, null, null

    union...

  • RE: Query Optimization

    The DISTINCT keyword is the same as a group by with no aggregates. I don't know if it's faster or not.

  • RE: Switching database context

    This is what he is saying:

    set @sql_str='select * from mydatabase.dbo.mytable'

    If you fully qualify the tablename prefixed with the database, you can execute against that table regardless of the connection context...

  • RE: Why is my data being truncated?

    Go to Tools|Options|Results tab

    and set the max characters per column value higher...

  • RE: SQL JOIN - Questions

    Mahesh, I disagree. From what I understand, the query optimizer will determine which table to select from first. I've experimented with changing my join order around, and the query plan...

  • RE: Update with cursor

    You'll have to make it a dynamic query. That is, build your sql string, and execute it

    declare @sql nvarchar(max)

    Set @sql = 'update ' + @tablename...

  • RE: What sort of style of SQL is this?

    And if you forget a condition in your where clause linking two of the tables together, it is an implicit CROSS JOIN.

  • RE: Selecting against multiple-table "has a" relationships

    Hmmm. Since the columns are the same across the two, I'd create one table, and simply have another column indicating "type" whether it be a numeric value(1,2) or a char(1)...

  • RE: Help with Execution Plan

    1. Tables scans are bad. Maybe some indexes on the temp tables depending on how large they are.

    2. Joining to table valued functions can also significantly impact performance.

    We went down...

  • RE: detect trailing spaces

    Hmmm...or more circuitously:

    Select * From table where len(myColumn) + 1 <> len(myColumn + '.')

    I'm sure there's a flaw in my logic here, but the idea is to exploit the behavior...

  • RE: temp table not dropped

    I believe that the temp table will stay there as long as you have the SSMS window open, which is why when developing, I always put the drops in so...

  • RE: Historical prices with data gaps

    you can research the AVG and MAX aggregate functions. There are plenty of samples in BOL.

  • RE: temp table not dropped

    If I'm not mistaken, #temp table are implicitly dropped at the end of the stored procedure regardless of whether or not you explicitly drop it. ##temp tables (global ones) must...

  • RE: Efficient Query

    It's efficient when your users aren't complaining that its slow 🙂

Viewing 15 posts - 16 through 30 (of 153 total)