Showing posts with label provided. Show all posts
Showing posts with label provided. Show all posts

Monday, March 19, 2012

How to get size of a table

Hello,

I want to get size of a particular table. I have used the wizard provided by SQL Server Enterprise Manager. But it is giving wrong size. If the data of some cells has been deleted or some rows are deleted. It shows the same size which it shows for the first time. I have also used sp_spaceused but is showing the same behaviour as mentioned above. I deleted some rows from the table but is showing the same size.I want to know the size exactly, so that i can come to know that some rows has been deleted or data is corrupted. Please tell me the solution as early as possible.

Haider Ali Khan

sp_spaceused()

Wednesday, March 7, 2012

How to get months and year

Hi All,

I provided the client with the dropdownlist which lists all the months (january - december). This input will be used to filter in the invoiceDT.

How can I write the query where clause to compare the invoiceDT (mm/dd/yyyy) into this input which is only number 1 through 12?

TIA

hi,

you can use following

" select * from table where ( datepart(mm,invoicedt) = "+ddlmonthfrom.SelectedIndex // i assume you've 1 additional item in dropdown.

the problem with this query is say you've 2 years data & you select say may, it will list data for may month of both years.

hope it helps,

regards,

satish.