Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: Getting my head around this

    You could also multiply one of the operands by 1.0 to cast it, and hence cast the result...

    select count(date_of_birth) as A,

           count(*) as B,

           count(*)*1.0/count(date_of_birth) as C

    from myTable

    It's a little...

  • RE: Calculate the last working day of the previous month

    You could try something like this...

    select CASE

      When datepart(dw, dateadd(d, -datepart(d, getdate()), getdate())) = 7

        Then dateadd(d, -datepart(d, getdate()), getdate()) - 1

      When datepart(dw, dateadd(d, -datepart(d, getdate()), getdate())) = 1

       ...

  • RE: DTS Package executed.

    You could also put the package into a job and use msdb..sp_start_job if you need the package to run on the server.

  • RE: Reclaim space from Dropped Columns

    Thanks guys for the help.

    I have resolved this by adding a primary key to the table.  There were no indexes on the table at all

  • RE: Reclaim space from Dropped Columns

    No to worry Shawn... I appreciate the effort.

    I have added up the datatype sizes for the shortened history table...  it comes to 725 bytes.  There are 13,918,290 rows... giving a...

  • RE: Reclaim space from Dropped Columns

    Is there a way to retrieve the row size of a table or is it a case of adding up all the data type sizes?

  • RE: Reclaim space from Dropped Columns

    Thanks for the reply Shawn... however unfortunately all of the columns that have been dropped were numeric columns.  DBCC CLEANTABLE only reclaims space from variable length (varchar and text) fields.

    I...

  • RE: DTS Execute SQL Task

    There is an article on this subject here: http://www.sqldts.com/default.aspx?234

  • RE: DTS Newbi

    I have found http://www.sqldts.com/ to be pretty helpful.  There are some nice tutorials and good articles on this site... check it out.

  • RE: CURSOR With Dynamic SQL

    If you must use a cursor then

    exec 'DECLARE crs_pn CURSOR FOR ' + @SQL

    should work.

  • RE: T-SQL book recommendation

    I have learned a lot by subscribing to the SQLServerCentral daily update and keeping an eye on these forums. Also some great scripts and articles on the site.

  • RE: Table Constraints

    Thanks mccork, that is exactly what I was looking for... I was unaware that you could use Functions in constraints...

    Thanks again!

Viewing 12 posts - 1 through 12 (of 12 total)