Monday, July 28, 2008

Monday, July 21, 2008

SQL Query to select first day and last day of month

declare @date datetime, @first datetime, @last datetime
set @date = getdate()
set @first = cast(month(@date) as varchar(2)) + '/1/' + cast(year(@date) as varchar(4))
set @last = dateadd(d, -1, dateadd(m, 1, @first))
select @first, @last

select dateadd(mm,datediff(mm,0,getdate()),0)
select dateadd(ms,-3,dateadd(mm,datediff(mm,0,getdate())+1,0))
select dateadd(ms,- 3,dateadd(mm,0,dateadd(mm,datediff(mm,0,getdate())+1,0)))

Export Stored Procedure results to text file

Use the BCP command.... You will need to have access to xp_cmdshell which is an advanced setting in sp_configure...
exec master..xp_cmdshell 'bcp "exec myDB..uMyProc" queryout c:\umytable.txt -T -c'

Wednesday, July 16, 2008

Type Lib Not Found in global.asa

Open a blank project in visual interdev...add the the references included in the global.asa files and replace the meta tags with the new tags in the project created global.asa file


Also allow permission for ASP extensions in webserver extensions in IIS to load ASP pages