Viewing 15 posts - 6,646 through 6,660 (of 8,731 total)
jasona.work (3/31/2014)
ChrisM@Work (3/31/2014)
March 31, 2014 at 7:29 am
Maybe this code will give you an idea.
DECLARE @FYint=14,
@P int=3;
DECLARE @Date date
SET @Date = CAST( @FY as CHAR(2)) + RIGHT( '0' + CAST( @P AS varchar(2)), 2) + '01'
SELECT...
March 29, 2014 at 8:56 am
This function can certainly be converted into an inline table-valued function. It's tricky, but it can be done and it has nothing to do with parameters as the previous one...
March 28, 2014 at 6:06 pm
This is a repeated post which was asked in here: http://www.sqlservercentral.com/Forums/Topic1555882-391-1.aspx
I would use the date math as Sean suggested to get
DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)
March 28, 2014 at 12:52 pm
You're setting your variable to 'SELECT MAX(CODIGO) FROM SGCTCENTRAL.DBO.SINCRONISMO' and that is a string value. You need to use dynamic code by using sp_executesql (preferred method) or EXECUTE().
If your query...
March 28, 2014 at 12:49 pm
Sean Lange (3/28/2014)
Luis Cazares (3/28/2014)
March 28, 2014 at 9:43 am
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select...
March 28, 2014 at 9:29 am
WayneS (3/27/2014)
Luis - thanks for linking to my article. However, I'm afraid that it doesn't do much for helping to learn how to remove cursors. For that task,...
March 28, 2014 at 9:10 am
@SQLFRNDZ (3/27/2014)
Of course, Prevention is better .. I have seen a database like this recently with one of my client configured in FULL and never backup for log, I have...
March 27, 2014 at 6:59 pm
Jeff Moden (3/27/2014)
Grant Fritchey (3/27/2014)
jcrawf02 (3/27/2014)
We have a written test we use to weed out people who don't know the first thing about SQL (report writing position, not DBA stuff),...
March 27, 2014 at 5:59 pm
How is it possible that someone writes a cursor instead of using SUM()?
I'm afraid that this database is full of these pieces of sh code and it's slower than a...
March 27, 2014 at 5:54 pm
Talk about RBAR on steroids and overcomplicating things. These cursors are just going row by row adding a value. This is totally unnecessary if you know about aggregate functions. In...
March 27, 2014 at 5:41 pm
The subquery looks fine, you're filtering using JOINs. You could change them to IN or EXISTS and you might have a slight performance gain, but it might not be...
March 27, 2014 at 4:04 pm
When you execute the code, SQL Server doesn't care if the code is dynamic or static. As long as the instruction in the dynamic code becomes exactly the same code...
March 27, 2014 at 1:38 pm
Each column of a resultset will have one header. You could remove the UNION ALLs to have 3 resultsets, add a column for the description of the row or have...
March 27, 2014 at 1:26 pm
Viewing 15 posts - 6,646 through 6,660 (of 8,731 total)