Forum Replies Created

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

  • 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.

  • RE: Create or Alter a stored procedure

    I agree with Grasshopper, however if you truely need to do this consider the "undocumented sp_MSForeachDB and sp_MSForeachTable" stored procedures. 

    Here is some sample code: (this may be more bother...

  • RE: Moving mdf, ndf and ldf files to another SQL Server2000

    I'm not sure I'm following all your questions.  Are you saying all you have are the data files?  If that is the case you might look up the "Attach database"...

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