Viewing 15 posts - 196 through 210 (of 388 total)
What is the formula you used to get this number?
September 29, 2008 at 12:02 am
So what is the exact output you are expecting from this date value?
September 28, 2008 at 10:12 pm
Could you explain what exactly you are trying to achieve? Probably you may not need to do what you are trying to do now.
SQL Server stores a DATETIME value...
September 28, 2008 at 9:43 pm
Try this:
SSET DATEFORMAT DMY;
SET NOCOUNT ON;
DECLARE @t TABLE (SaleDate DATETIME, ItemCode INT)
INSERT INTO @t (SaleDate, ItemCode) SELECT '27-09-2008 09:30:00',1
INSERT INTO @t (SaleDate, ItemCode) SELECT '27-09-2008 09:45:00',1
INSERT INTO @t (SaleDate, ItemCode)...
September 28, 2008 at 11:15 am
Try this:
DECLARE @date DATETIME
SELECT @date = '5/31/2009'
SELECT @date = DATEADD(year, -1, @date) + 1
SELECT @date AS date
/*
date
-----------------------
2008-06-01 00:00:00.000
*/
September 27, 2008 at 6:50 am
or is it what you are looking for?
select cast(getdate() as int)
/*
39717
*/
select cast(39717 as datetime)
/*
2008-09-28 00:00:00.000
*/
September 27, 2008 at 6:16 am
Database publishing wizard can help you: http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
Also, if you have the Management Studio of SQL Server 2008, it has an option to generate the INSERT scripts for...
September 26, 2008 at 6:31 am
It returns the number of days from '1900-01-01'
September 26, 2008 at 3:34 am
Jim,
You are right. I am not able to download as well.
Let me contact Steve, he might be able to help.
regards
Jacob
September 25, 2008 at 6:59 am
May be there is a misunderstanding. On the top of each example, (on the left side) there is a hyper link that helps you to download a text file...
September 25, 2008 at 6:25 am
The title of each example that says "example #" is a link. You can click on that to download the source code of each example.
September 25, 2008 at 4:32 am
I think it will be lot easier if you use the XML approach. You can return a rowset containing the values in your delimited string and use that directly in...
September 24, 2008 at 11:20 pm
Try this:
-- '2008-09-24 14:19:56.293' I WANT '2008-09-24 14:00:00.000'
DECLARE @d DATETIME
SELECT @d = '2008-09-24 14:19:56.293'
SELECT DATEADD(hour, DATEPART(hour, @d), DATEADD(d, 0, DATEDIFF(d, 0, @d)))
/*
output:
-----------------------
2008-09-24 14:00:00.000
*/
September 24, 2008 at 3:30 am
When SQL Server reads a row from a table, it applies a SHARED lock on the row (under default transaction isolation level: READ COMMITTED). If the row is already locked...
September 24, 2008 at 3:26 am
From inside your trigger, you can access the INSERTED virtual table. This table will have the same structure as your main table and contain only the newly inserted data. You...
September 24, 2008 at 2:26 am
Viewing 15 posts - 196 through 210 (of 388 total)