Viewing 15 posts - 5,791 through 5,805 (of 8,731 total)
Just to be clear on what Phil is commenting.
There's a big difference between SELECT...INTO... and INSERT INTO...SELECT...
The first option will create a table, the second one will just insert rows....
September 23, 2014 at 8:58 am
Am I missing something here? Wouldn't a simple LEFT() do the job?
WITH SampleData AS(
SELECT RAND(object_id) * 1000 N
FROM sys.all_columns
)
SELECT N, LEFT( N,...
September 22, 2014 at 2:58 pm
Without knowing how to identify the Current Day's business, I just can help by leaving this article:
http://www.sqlservercentral.com/blogs/lynnpettis/2009/03/25/some-common-date-routines/
That way you don't need to hardcode the date.
To transfer directly to quickbooks, you...
September 22, 2014 at 8:48 am
Maybe The Thread just took some days off to enjoy some BBQ. 😀
September 22, 2014 at 8:45 am
You shouldn't be storing times as nvarchar. SQL Server has a time datatype (and plenty others datetime types).
We also have the function DATEDIFF available so we don't have to reinvent...
September 19, 2014 at 3:31 pm
I need to wait for some maintenance tasks to complete (including moving the instance to a not-shared node). After everything completes, I'll give it a try. That was exactly my...
September 19, 2014 at 12:22 pm
The row counts are normal, the normal run should be in under 20 minutes but sometimes it takes really long time to complete.
The column is not needed, but it doesn't...
September 19, 2014 at 10:58 am
I'm not sure if this is enough:
Memory 524278 MB
Processors 80
cost threshold for parallelism5
max degree of parallelism4
Version Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) Jun 28 2012...
September 19, 2014 at 10:28 am
You're not referencing your CTE on your UPDATE statement. Additionally, you don't have anything to make a relationship (and that's caused by the previous reason).
You don't actually need a CTE,...
September 19, 2014 at 10:02 am
Ed Wagner (9/19/2014)
HanShi (9/19/2014)
GilaMonster (9/19/2014)
Database goes into Restoring mode
Performance tuning it so critical can any one plz figure it...
September 19, 2014 at 8:06 am
The "Lazy N" was really a mistake on my part. I was going to change it into something descriptive, but I forgot to do it before copying the code.:blush:
September 18, 2014 at 4:47 pm
N stands for "Nothing in particular" 😀
I support your code if it's accompanied by the proper comments describing what it does. I'm not trying to be pedantic, this is more...
September 18, 2014 at 4:30 pm
I haven't tested the following code but it should give you an idea.
With Rownums AS(
SELECT *,
...
September 18, 2014 at 3:47 pm
It's easy when you have the code to generate the Tally Table available.
Do you know what is a tally table? How is it built here?
To know more about it, read...
September 18, 2014 at 2:37 pm
Something like this could do the trick and you can convert it into an inline table valued function which would be as fast as the normal query.
DECLARE @Start date =...
September 18, 2014 at 2:17 pm
Viewing 15 posts - 5,791 through 5,805 (of 8,731 total)