Viewing 15 posts - 7,141 through 7,155 (of 8,731 total)
A scalar defined function as you posted, will giev you performance problems. Try to use an iTVF as explained on this article to make it perform much better.
January 21, 2014 at 11:52 am
A couple of additional methods 🙂
IF (FLOOR(@number) = @number)
PRINT 'whole number';
ELSE
PRINT 'has fractional component';
IF (CEILING(@number) = @number)
PRINT 'whole number';
ELSE
PRINT 'has fractional component';
January 21, 2014 at 9:09 am
To use the solutions provided with a table column instead of a variable. You just need to change the variable declaration to a function definition and call it with cross...
January 21, 2014 at 8:54 am
Here's an extract of the procedure to populate date dimension (I removed columns needed in my company and left some that might be relevant). We populate it by year, sowe...
January 21, 2014 at 8:38 am
blasto_max (1/20/2014)
Try this example - Select any data from SQL server into a result set (hint SSIS Object) and use a script task to write it to a file.
To write...
January 20, 2014 at 3:26 pm
Here's an article that might help you. It's part of a Stairway Series and I recommend you to read the complete series 😉
http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/99720/
January 20, 2014 at 2:33 pm
I haven't gone deeply into it, but an article from today's homepage might help. https://www.simple-talk.com/sql/database-administration/the-posh-dba---reading-and-filtering-errors/
January 20, 2014 at 2:07 pm
That's exactly what I had in mind. It's always better when people are able to find an answer on their own.
By the way, you should think on changing the design...
January 20, 2014 at 2:04 pm
This is easily accomplished with joins and an aggregate function. I have no intention on doing your homework, but I can guide you on specific questions that you have.
In short,...
January 20, 2014 at 1:02 pm
This script might help you.
DECLARE @bd varchar(128),
@Table_Namevarchar(128) = 'TABLE_NAME_SEARCHED'
CREATE TABLE #Tables(
bdvarchar(128),
table_namevarchar(128))
DECLARE bases CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY FOR
SELECT name
FROM sys.databases
WHERE database_id > 4
AND state = 0
OPEN bases
FETCH NEXT FROM bases...
January 20, 2014 at 9:38 am
Shanmuga Raj (1/20/2014)
I need to use recursive funtion since i have the stored proedure with more data columns.
No, you don't. You need to understand how the query works to use...
January 20, 2014 at 9:30 am
richardmgreen1 (1/20/2014)
So the cte is almost acting as a temporary table having an insert done on it?That makes sense.
It's more like a single use view. Remember that even if it...
January 20, 2014 at 8:36 am
As Sean said, a recursive function will give a horrible performance.
For cases like this one, I like to use recursive CTEs, but you might to be aware that performace will...
January 20, 2014 at 8:34 am
Here's a different method that might work well. Should we start testing? 😀
DECLARE @code nvarchar(4000) = '12333345566689';
with seed1 (a)
as
(
select 1 union all select 1...
January 20, 2014 at 8:14 am
I'll try to explain. You could think of a CTE as if it were a subquery. You can select the query in the cte to view what is the result...
January 20, 2014 at 8:03 am
Viewing 15 posts - 7,141 through 7,155 (of 8,731 total)