Viewing 15 posts - 226 through 240 (of 423 total)
Maybe this is getting closer? It still has issues with the first and last entry of a batch. For any time gap more than 1 hour I just add one...
March 8, 2013 at 7:57 pm
RZ52 (3/7/2013)
Thanks for suggestion. I think this would also help me in other situations as this has less limitation.
Another advantage of this method is that you can make an inline-table...
March 8, 2013 at 8:58 am
This turned out to be much trickier than I thought. I figured out a way to do it in two passes. May not be optimal and I didn't have time...
March 7, 2013 at 7:47 pm
I always use MERGE now rather than several IF blocks (unless I'm stuck with SQL2005 and earlier). It's important to test the merge before using it on live data though!...
March 7, 2013 at 3:05 pm
Just to add another option with a slightly more complex query that doesn't require a seed value. Also, by adding identity columns it will keep the rows in the same...
March 7, 2013 at 2:38 pm
Sergiy (3/5/2013)
Steven Willis (3/4/2013)
March 5, 2013 at 4:28 pm
You can check the collation on your db with:
(code from Pinal Dave)
SELECT
c.name
,c.collation_name
FROM
sys.columns c
WHERE
OBJECT_ID IN
...
March 5, 2013 at 11:45 am
This is what I got when I used your code in SSMS as is. It looks correct for me. So perhaps something specific to your database settings (like collation) is...
March 5, 2013 at 11:36 am
calvo (3/5/2013)
Steven Willis (3/5/2013)
...
You...
March 5, 2013 at 11:26 am
Another old habit to break if you are using SQL2008 or greater is to avoid GROUP BY when all you really need is an aggregated column value.
SELECT
...
March 5, 2013 at 9:47 am
Here's another option for formatting dates. I didn't create the logic behind this function other than to turn it into an iTVF rather than its original scalar form. I don't...
March 4, 2013 at 10:23 pm
Sergiy, you make some good points. However, in my original post I wasn't particularly concerned with the excess of zeroes because like you said, it's better that the UI handle...
March 4, 2013 at 7:13 pm
newdba_sql (3/4/2013)
I want to get a list of all databases and servers...
March 4, 2013 at 1:48 pm
OK, here's a start. I'm sure the gurus will find a way to maximize this such as getting rid of the WHILE loop. I tried to do it without a...
March 3, 2013 at 10:31 pm
Jeff gives good advice...but I will agree that SET ROWCOUNT 0 is not exactly intuitive.
Hmmm... now is it SET NOCOUNT 0 or SET NOCOUNT OFF? Do you expect consistency?...
February 27, 2013 at 11:26 pm
Viewing 15 posts - 226 through 240 (of 423 total)