Viewing 15 posts - 3,706 through 3,720 (of 3,956 total)
Why would you:
1. Store a 1 in column default? In what way, is "1" a unique attribute of the entities in the table object?
2. Store a running total? ...
April 25, 2012 at 7:10 pm
Jeff,
There's nothing like proving it to yourself rather than relying on anecdotal evidence.
Try creating a test harness where you INSERT 1000000 rows of data, first with SPACE and then with...
April 25, 2012 at 6:47 pm
If you want to get a value returned to a local variable, you'll probably need to use sp_executesql:
April 25, 2012 at 6:39 pm
I suggest a modification to Capn Hector's suggestion as follows:
SELECT RTRIM(SUBSTRING(ColA,1,20))
This way, strings less than 20 in length will be stored without blank padding.
April 25, 2012 at 6:31 pm
Here's another way:
DECLARE @datetest TABLE ([test_date] [datetime] NULL
)
insert into @datetest
select '2012-04-25' union all select '2011-12-31'
union all select '2011-12-27' union all select '2011-12-23'
union all select '2011-12-23' union all select '2011-12-20'
;WITH a...
April 25, 2012 at 6:27 pm
I omitted that because I was in a hurry. Just use something like this:
':' + RIGHT('00'+CAST(Tue%60 AS VARCHAR),2)
April 25, 2012 at 6:17 pm
GPO - Not always as easy as we would like.
I have a vague recoolection that you can convert uniform random numbers to another distribution by multiplying by the inverse of...
April 25, 2012 at 7:08 am
If I have hit upon the root cause of your issue in my prior post, the correct course of action on your part would be to use an INT datatype...
April 25, 2012 at 4:39 am
The following fields in the table have a time datatype-
MonHours
TueHours
WedHours
ThuHours
Frihours
The requirement is to add the values for all the fields above after doing a SUM for each of them.
It...
April 25, 2012 at 2:41 am
Thanks Vinus for the +1!
I'm betting (without actually testing it) that it runs with "fire breathing efficiency" to quote Jeff from the latest article he published today.
April 25, 2012 at 1:44 am
I hope you really are like yoda. I am in need of a SQL master to guide this noobie padawan learner
I feel the same way.
I somehow managed to get into...
April 25, 2012 at 1:18 am
How's about something like this:
DECLARE @abc TABLE (Date DATETIME, Amount INT, Category VARCHAR(10))
INSERT INTO @abc SELECT '2012-04-13',1000,'a'
UNION ALL SELECT '2012-04-12',500,'b' UNION ALL SELECT '2012-04-11',7000,'c'
UNION...
April 25, 2012 at 12:55 am
You da man Jeff! Another great article!
I've seen quite a few forum posts recently where your discussion of how DATETIMEs actually work would have assisted the posters had they...
April 25, 2012 at 12:04 am
QUESTION:
What would you say is a reasonable threshold for the amount of time a cursor should remain open in SQL Server?
ANSWER:
0 msec. They shouldn't be using CURSORs at all....
April 24, 2012 at 10:49 pm
Cadavre,
First some compliments for you:
1. I love your @holder variable concept.
2. I also like the PRINTs into the message pane - very effective for isolating the interesting results!
Observations:
1. The overhead...
April 24, 2012 at 10:34 pm
Viewing 15 posts - 3,706 through 3,720 (of 3,956 total)