Use a format parameter with convert !
Code:
declare @x datetime2
set @x = CURRENT_TIMESTAMP
print '1:' + convert(char(30),current_timestamp, 121)
check books online http://msdn.microsoft.com/en-us/library/ms187928.aspx
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
I guess I am a little confused by what you mean by refresh? based on the query you are running I would suspect that it would take so little time that the value would never be different. now you may be able to get a unique value on each line by adding in the nano seconds but I am not sure that is what you are talking about. could you clarify the refresh request?
Dan
If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
mister.magoo:
I don't understand how to use the profiler. Could you point me to a good resource.
Thanks.
mike 57299 (6/24/2010)
mister.magoo:I don't understand how to use the profiler. Could you point me to a good resource.
Thanks.
Not really, sorry... I just learnt by trial and error. It's not something I think I should advise anyone else on in case I give them bad habits, but I will show the basics because they are simple :-
1) start a query session in SSMS to run your stored proc and note the SPID
2) launch SQL Profiler from your menu and start a new trace
3) modify the trace to include Stored Procedures -> SP:StmtCompleted
4) add a filter on SPID to only include the SPID of the query session in which you will run the stored proc.
5) start the trace
6) run the stored proc
7) stop the trace
8) review the trace to see which statements took the longest
See below for a quick shot of the elements I mentioned here:
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply