Thursday, March 1, 2012
SSRS issue - Cannot read the next data row for the dataset
The result was to look at my date format and adjust it and publish the reports and it worked. I have written 100's of reports with dates and never had this issue.
Tuesday, September 16, 2008
Bug Shooting Tool for Screen Capture
Tuesday, February 5, 2008
Last Modified / Created When - DB Objects
1) The following query will tell you exactly which stored procedure or user table got modified say in the last 3 days.
SELECT name
FROM sys.objects
WHERE type in ('P', 'U')
AND DATEDIFF(D,modify_date, GETDATE()) < 3 -- 3 is a changeable value.
2)The following query will tell you exactly which stored procedure or user table got created say in the last 3 days.
SELECT name
FROM sys.objects
WHERE type in ('P', 'U')
AND DATEDIFF(D,create_date, GETDATE()) < 3 -- 3 is a changeable value.
I have a customer who has parameterized the value 3 in terms of hours because they have development resources in 3 different countries and they want to Police the coding standards.
Source - SQL Authorty, Pinal Dave
Sunday, February 3, 2008
Finally a really free PDF Editor
I use OpenOffice quite frequently in my personal laptop and can vouch it is awesome!
SQL Server Maintenance tips from SQL Anuthority.
Tuesday, January 1, 2008
Delete files from the network based on file path and date/time parameters.
Delete files from the network based on file path and date/time parameters.
This script came in handy when I was trying to delete some old XML documents from the network. The best part about this script was we were able to schedule to execute this script from windows scheduler. I created this script with the help of Michael Scott.
'*******************************************************************************************
' Created BY : Srinivasan Prasanna
' Company : Company ABC
' Date : 09/05/2007
' Logic : This script is run as a batch program to remove the files from the
' selected folder
' : This script was created with the help of an internet resource - Michael
' Scott
'*************************************************************************************
Dim fso, fldr, fc, f1 'fldname, usrname, srcFile
set FSO = Wscript.CreateObject("scripting.FileSystemObject")
fldname = "D:\HJS\DCA\Peoplesoft89\XML\Export" '<---- change to top directory Const DateofFile = -30 '<----- age of deleted files
DeleteFiles = FSO.GetFolder(fldname)
Set fldr = fso.GetFolder(fldname)
Recurse fldr
Set fldr = Nothing
Set fso = Nothing
wscript.echo "Files Deleted Successfully"
Wscript.Quit
Public Sub Recurse( ByRef fldr)
dim subfolders,files,folder,file
Dim srcFile
Set subfolders = fldr.SubFolders
Set files = fldr.Files
For Each srcfile in files
If DateDiff("d", Now, srcFile.DateLastModified) < DateofFile Then
FSO.DeleteFile srcFile, True
End If
Next
'************** Recurse all of the subfolders.
For Each folder in subfolders
Recurse folder
Next
'************** Deletes empty folders
if (fldr.files.count = 0) and (fldr.subfolders.count) = 0 then
on error resume next
fldr.delete
exit sub
end if
End Sub
You can also download this script from the google document site
Monday, December 31, 2007
Reset an identity column of a table in SQL Server
DBCC CHECKIDENT(table_name, RESEED, 0).
The table_name is the parameter that you would need to change per your table name. Also, this may be a good candidate to have a front end for the administrator to do maintenance in the future. Although, if you have a DBA he would rather prefer to execute this script from SQL management studio.
