Forum Replies Created

Viewing 15 posts - 271 through 285 (of 291 total)

  • RE: Set based thinking / Query

    I don't think you gave me enough information to solve the problem.  I'm giving it a stab but making a lot of assumptions that probably are not correct.

    Assumptions:

    1. No duplicate...

  • RE: Available rooms for a time slot during a date range query...with day of week filter

    I don't know if the will help, but after looking at your design and query I gave it up as "not worth the effort".  The design is not suited to...

  • RE: How to interprete this script?

    Step back from the problem and look at the result of the "JOIN" clause.  A left join will retrieve all rows from the tblSysSp table, and for each row it...

  • RE: Updating a production database with back up of development database

    This is a pretty vague request.  Do you simply want to over write the current production database?  If so then a simple restore of a backup:

    --Backup the development database

    backup database...

  • RE: How to get this output ?

    /* I always work best with examples, so I've recreated your table (sort of), populated it with some test

       data and then provided a SQL Script to report it the...

  • RE: help with syntax

    While I agree with some of the other posts that nobody should take your test for you I'll assume you have a legitimate interested in learning the answers to these...

  • RE: locking hints

    First I don't think you really need the "If Exists" portion of the SQL statement, at least not in the context you are using it. Second change the cmdSP1.ExecuteReader to...

  • RE: count in joins

    There are several ways to perform the query, the simplist would probably be:

    SELECT post.post_id, aspnet_Users.UserName, post.post_name,

           post.post_date, post.post_views, (select count(comment.comment) from comment where comment.post_id = post.post_id) as Total_Comments

    FROM   post...

  • RE: Need Help On Query

    Unless I've missed something in your question the query is straight forward:

    Select * from [tablename]

    That will return the data from the table, listed row after row with the column names...

  • RE: Drop and Create column in the same position (TSQL), as it was before dropping

    -- Quick example of dropping/creating a column in same location.

    -- Basically we are going to move the data to a temp table, drop and recreate the existing table

    -- and copy...

  • RE: replacing one string of text in a table with another

    Well, I recommend a backup just before you perform the change.  That is always the best policy.  If you just want to keep the data around for a little while...

  • RE: replacing one string of text in a table with another

    --Same principal as the last example

    update yourTable_

       set col2_ = replace(col1_,'\','@') + '.com'

    --You can get more specific

    update yourTable_

       set col2_ = replace(col1_,'DOMAIN\','DOMAIN@') + '.com'

    --Or just those records where col1 begins...

  • RE: Inserting Only Unique Records

    --Here is a method to eliminate dups:

    --First select all the columns of the existing table into a temp table (make sure you have enough disk space for this)

    --adding a new...

  • RE: replacing one string of text in a table with another

    Here is how you can use the REPLACE command:

    UPDATE [tablename]

       SET [columnname] = Replace([columnname],'existing string value','new string value')

      

    obviously you can use the WHERE clause to limit what data...

  • RE: Default Value Getdate()

    Make sure your package is not referencing the "loaddate" column in it's update/insert statement.  Exclude that column and it should work as expected.

Viewing 15 posts - 271 through 285 (of 291 total)