Viewing 12 posts - 1 through 12 (of 12 total)
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...
November 1, 2005 at 4:58 am
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
...
August 31, 2005 at 3:34 am
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.
August 19, 2005 at 3:19 am
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
August 12, 2005 at 5:44 am
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...
August 11, 2005 at 8:20 am
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?
August 11, 2005 at 7:53 am
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...
August 11, 2005 at 7:36 am
There is an article on this subject here: http://www.sqldts.com/default.aspx?234
July 1, 2004 at 7:03 am
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.
May 19, 2004 at 4:19 am
If you must use a cursor then
exec 'DECLARE crs_pn CURSOR FOR ' + @SQL
should work.
October 30, 2003 at 5:33 am
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.
October 29, 2003 at 3:06 am
Thanks mccork, that is exactly what I was looking for... I was unaware that you could use Functions in constraints...
Thanks again!
June 25, 2003 at 5:40 pm
Viewing 12 posts - 1 through 12 (of 12 total)