Wednesday, July 30, 2008

itunes.msi not found when tryinh to unistall Itune

when trying to update or unistall Itunes on windows, it complains about a missing Itunes.msi file. If you Browse for this file however, you’ll find it in the location that it’s supposed to be (C:\Program Files\Apple Software Update\Packages).
I tried a few things to fix this, including downloading the latest iTunes from Apple’s website. After about 30 minutes of digging, I discovered that there’s a simple fix.
1) Download the Windows Installer Cleanup Utility
2) Install the program (MS Office not required!)
3) Run the program from Start->All Programs->Windows Install Cleanup Utility
or run msicuu2.exe
4) Click on iTunes, and then click the “Remove” button -( if again same error comes just ingnor & go next step )
5 ) Run the iTunes installer
All in all the process took about 2 minutes, and once again download and listen favorite podcasts

Tuesday, July 22, 2008

Reporting Services 2005 Dynamic connection string

For report Shared data set use
="Data Source=" & Parameters!server.Value & ";Initial Catalog=" & Parameters!database.Value

For stand alone dataset
Data Source=PARAMETER!server.value;Initial Catalog=PARAMETER!database.value
Some Bugs in Reporting Service 2005
- Make Sure everytime you change anything or open report that Command type is Store procedure or Text . If you use Store procedure , It will change to text.
- If you use a Credential (User Id & password) even standard user ID & pass. when open reports from different user account It will go away. so, when you diploy report make sure Credential are there.

MS SQL (7/2000) database "Suspect Mode" / "Emergency Mode" / "Error 1813

Recovering MSSQL from "Suspect Mode" / "Emergency Mode" / "Error 1813"

For SQL 2000 database some time database goes into suspect mode, when you trying to delete database directly.

sp_configure "Allow updates" , 1
update sysdatabases
set status = status & ~ 256
where (name = 'SuspectDatabaseName')
sp_configure "Allow updates" , 0

* user must be SQL admin user.
it will restore database.

if still not works go for hotfix

click here

try this
(good post)

keep in mind

The issues that are fixed by this hotfix package.
The prerequisites for installing the hotfix package.
Whether you must restart your computer after you install the hotfix package.
The files that are contained in the hotfix package।

"Suspect Mode" --> "Emergency Mode"
Open Enterprise Manager,
Right click onto your server node, - an SQL Server Properties dialog will popup,
Enable "Allow modifications to be made directly to the system catalogs" option
Now proceed to the sysdatabases table in the master database, locate your database row and put 32768 into its status column
Restart SQL Server and refresh Enterprise Manager
Open Enterprise Manager - the database will be marked as "Emergency Mode"
These articles explain the trick behind suspect and emergency mode:
3. "Emergency Mode" --> "Normal Mode"
Now your database is in "emergency mode". Disregard Enterprise Manager does not show tables, views and procedures - use Query Analyzer's Object Browser instead.
"Emergency mode" means database is locked against any modifications, it is readonly forever. There is no way to bring "emergency" database back to normal state. All we can do is copy all data from it into new database.
Create new database (pubz)
Create new DTS package
Use "Copy SQL Objects" task to transfer data from old database to new database (pubs->pubz)
Execute the DTS job & enjoy!
Note that there might be complex dependencies between database objects, so Copy SQL Objects task might not work properly. For example: view A is dependent on view Z; Copy SQL Objects task will try to create view A first, -- that will fail, because view Z does not exist yet.
4. "Error 1813" --> "Suspect Mode"
If you receive "Error 1813", this probably means that you are trying to attach database you have improperly detached, or haven't detached at all. Only successfully detached databases can be successfully attached back.
Create new database using the same name and file location as database that is failing to attach
Stop SQL Server
Copy non-attachable data files over the new ones
Delete log files
Start SQL Server
Open Enterprise Manager - the database will be marked as "suspect"
Once your database is "suspect", use instructions outlined above...
Note that database will be marked "suspect" only if transaction log contained active sections. To illustrate the problem for 100%, run a few inserts against the database before deleting transaction log.

Monday, July 21, 2008

SQL find out two date between intervals

select getdate()
select dateadd("yy",-1,getdate())

dd - day
mm - month
yy - year

-1 - add -1 day/month/year in gurrent date.