Viewing 15 posts - 4,861 through 4,875 (of 10,144 total)
FollowingSaturday = DATEADD(day,6-DATEDIFF(day,6,Today)%7,Today)
-- example
;WITH ATableOfDates AS (
SELECT TOP(300)
Today = DATEADD(DAY,ROW_NUMBER() OVER(ORDER BY (SELECT NULL))-150,CAST(GETDATE() AS DATE))
FROM sys.columns
)
SELECT
Today,
[DayOfWeek] = DATENAME(weekday,Today),
FollowingSaturday = DATEADD(day,6-DATEDIFF(day,6,Today)%7,Today)
FROM ATableOfDates
April 10, 2013 at 6:05 am
If you examine the two plans in the first post of this thread, the first one – for the query with a constant predicate – has been considered for simple...
April 10, 2013 at 3:36 am
Krishna1 (4/10/2013)
How do u write it,
Begin tran
Commit tran
checkpoint
if i have 2 begin tran / commot tran...
April 10, 2013 at 3:12 am
sqldba_newbie (4/9/2013)
April 10, 2013 at 3:06 am
Hi Liam, welcome aboard. Before you start, have a read of this article[/url]. It describes how to post a question and what to include with it, to increase your chances...
April 10, 2013 at 1:50 am
Have a look at IDENTITY_INSERT in Books Online.
April 10, 2013 at 1:44 am
T.Ashish (4/4/2013)
I have attached two queries with table definition and sample data.
Query 2 is working better then query 1.
Now the actual question is:
Should I...
April 10, 2013 at 1:40 am
Two key points - don't shrink after load, it will only cost you next time around; and checkpoint after each COMMIT to clear completed transactions from the log.
Grant Fritchey has...
April 10, 2013 at 1:29 am
abhas (4/9/2013)
I found below code some where else which is resemble to my requirement. Now i want to insert whole result set into my database table. 🙂
DECLARE...
April 10, 2013 at 1:11 am
sudhirnune (4/9/2013)
Create procedure USP_TEST
@NAME NVARCHAR(20)
AS
BEGIN
IF object_id(N'tempdb..##TEMP_TEST') is not null
DROP table ##TEMP_TEST;
DECLARE @cols AS NVARCHAR(MAX),
...
April 10, 2013 at 1:09 am
This might help:
IF object_id('TempDB..#Temp') IS NOT NULL
DROP TABLE #Temp
CREATE TABLE #Temp (DateTimeRow DATETIME)
DECLARE @STARTDATE DATETIME, @StartTimeChar CHAR(5), @EndTimeChar CHAR(5);
SELECT
@STARTDATE = CAST(GETDATE() AS DATE),
@StartTimeChar = '08:00', -- note left-padded digit...
April 9, 2013 at 9:05 am
sudhirnune (4/9/2013)
1. I have te table which is Similar to TEST_SRC for which will tipically has 4000 to 5000 Payment...
April 9, 2013 at 9:04 am
abhas (4/9/2013)
Still facing an issue while inserting records. I have created Tally table with N. If i use select by applying join then data is showing properly but while inserting...
April 9, 2013 at 8:08 am
sudhirnune (4/9/2013)
yes and might increase at any point of time.
So to summarise, you want to take three or four very simple queries and convert them into a series of statements...
April 9, 2013 at 7:50 am
Viewing 15 posts - 4,861 through 4,875 (of 10,144 total)