显示标签为“period”的博文。显示所有博文
显示标签为“period”的博文。显示所有博文

2012年2月25日星期六

any method find the objects changed

i want to know is there any way to check any objects (table schema, sp,
trigger) changed at a period of time. say 5 days before.
i want to prepare the scripts for those modified objectsMullin wrote:
> i want to know is there any way to check any objects (table schema,
> sp, trigger) changed at a period of time. say 5 days before.
> i want to prepare the scripts for those modified objects
Not really... The crdate column in the sysobjects table always contains the
create date, not the last updated date.
But see:
Compare SQL Server Databases with sp_CompareDB
http://www.sql-server-performance.c...mparison_sp.asp
There is also a bunch of tools avaliable on the market for database
comparing, from www.apexsql.com or www.red-gate.com
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.|||Sounds to me like you need change management for your SQL source code...
There are alot of tools out there that will compare, but for what you describe DB Ghost
is the solution. Check out www.dbghost.com|||Hi,
Try dbMaestro. It's a product that allows comparison, migration and archivin
g of database schema and data, and display the changes in tables with beauti
ful gui.
You can find it here:
http://www.extreme.co.il|||Have a look at this
http://www.nigelrivett.net/DMOScriptAllDatabases.html
It will give you the day things changed - depending on how often you run
it.
and this
http://www.nigelrivett.net/SQLServerReleaseControl.htm
Which will save you heving to do the previous one.
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

2012年2月23日星期四

Any ideas on this one ?

If your RS parameter is set to a string, the original
> "convert(datetime,period,105)" should give you the listing you desire.
When
> this parameter is then passed to SQL it "should" automatically be
recognized
> as a date, but if not, you could pass the parameter as as string, and then
> declare and set a new SQL parameter to the cast(@.param as datetime).
This doesn't seem to work, if I set it to string and do the convert it still
shows the time.
I'm trying to do it the other way around but get syntax error, what could be
wrong here:
CREATE FUNCTION udf_MyDate (@.indate datetime, @.separator char(1))
RETURNS Nchar(20)
AS
BEGIN
RETURN
CONVERT(Nvarchar(20), datepart(mm,@.indate))
+ @.separator
+ CONVERT(Nvarchar(20), datepart(dd, @.indate))
+ @.separator
+ CONVERT(Nvarchar(20), datepart(yy, @.indate))
END
GO
SELECT DISTINCT PERIODESTART, DAY(PERIODESTART) AS Expr1, [dbo].[udf_MyDate]
(periodestart,'/') AS pstart
FROM DEBSTAT
WHERE (DAY(PERIODESTART) <> '31')
ORDER BY PERIODESTART
DROP FUNCTION [dbo].[udf_MyDate]
JackJack, recommend you check Books on Line. Here's what it says:"Using CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )"
Style is very useful here; you may need to experiment with it until you get
the output you want. By using this, you won't need a function. You can use
the convert statement in your query.
I hope this helps you.
Henry Robinette
"Jack Nielsen" wrote:
> If your RS parameter is set to a string, the original
> > "convert(datetime,period,105)" should give you the listing you desire.
> When
> > this parameter is then passed to SQL it "should" automatically be
> recognized
> > as a date, but if not, you could pass the parameter as as string, and then
> > declare and set a new SQL parameter to the cast(@.param as datetime).
> This doesn't seem to work, if I set it to string and do the convert it still
> shows the time.
> I'm trying to do it the other way around but get syntax error, what could be
> wrong here:
> CREATE FUNCTION udf_MyDate (@.indate datetime, @.separator char(1))
> RETURNS Nchar(20)
> AS
> BEGIN
> RETURN
> CONVERT(Nvarchar(20), datepart(mm,@.indate))
> + @.separator
> + CONVERT(Nvarchar(20), datepart(dd, @.indate))
> + @.separator
> + CONVERT(Nvarchar(20), datepart(yy, @.indate))
> END
> GO
> SELECT DISTINCT PERIODESTART, DAY(PERIODESTART) AS Expr1, [dbo].[udf_MyDate]
> (periodestart,'/') AS pstart
> FROM DEBSTAT
> WHERE (DAY(PERIODESTART) <> '31')
> ORDER BY PERIODESTART
> DROP FUNCTION [dbo].[udf_MyDate]
> Jack
>
>