Viewing 15 posts - 46 through 60 (of 78 total)
Well, if you are not sure how they will search data, what about if they will specify not selective condition. For example smth like "gender=F" or "field like 'a%' ",...
August 9, 2012 at 6:41 am
Gazareth,
Yes, exactly what I meant, thx!
pdanes,
Now I understand what are you trying to do, and my idea with temp table (even it is technically possible, and even if you'll find...
August 9, 2012 at 5:35 am
SQL* (8/9/2012)
I am learning sql server optimization,
declare @p1 int
set @p1 = 1
SELECT ProductID, SalesOrderID--, LineNumber
FROM Sales.SalesOrderDetail
WHERE ProductID > 1
ORDER BY ProductID
SELECT ProductID, SalesOrderID--, LineNumber...
August 9, 2012 at 5:10 am
vineet.007.mm (8/8/2012)
August 9, 2012 at 3:10 am
And what about creating temp table outside of the SP, just with command create table directly?
Anyway, I'd like to note that this approach maybe not so good.
Think, what will happen...
August 9, 2012 at 2:49 am
bala.sevva (8/9/2012)
I believed that Primary key needs an index (clustred/ non-clustred) but wanted to see if we can create it without index.
I have attempted with...
August 9, 2012 at 1:56 am
Hi! You can have a non-clustered primary key. All you have to do is make your column not nullable and it should be unique.
create table t1(date datetime, id int);
create clustered...
August 9, 2012 at 1:33 am
What about creating temp table not inside stored procedure.
create proc proc1
as
select * from #t1
go
For example, opening connection, creating temp table, executing procedure
create table #t1(a int);
insert #t1 values(1);
exec proc1
You may also...
August 9, 2012 at 1:16 am
Could you please clarify your question? What do you mean by "get" parameter? Get for what purpose?
If you want to display it for debug purpose you may use "print(@myParam)", or...
August 9, 2012 at 12:50 am
Good task! It has some not so obvious pitfalls, and not so easy as it may seem from the first look, imho.
Here is my notes about what should be taken...
August 8, 2012 at 10:30 am
SET DATEFORMAT is responsible for how character strings are interpreted when converted to datetime. It's not resposible for the way db stores datetime values, and not responsible for how these...
August 8, 2012 at 1:46 am
Maybe it is worth trying, to create primary key on #InstitutionChild.childaid if there isn't.
In general, without plans, all that is pure guess work, imho.
August 8, 2012 at 12:20 am
Here is one more
with t(v) as ( select '0008.22816' union all select '069.3142' )
select
[formattted] =
replace(str(parsename(t.v,2),7),' ','0') + '.' +
replace(str(parsename(t.v,1),7),' ','0'),
*
from t
Also, be aware that all presented solutions will fail...
August 8, 2012 at 12:14 am
It will be much more helpful, if you provide an Actual Execution Plan (in xml) for this slow query. If this is not a slow query by it self, but...
August 7, 2012 at 8:49 am
Well, I do all the tests on my local work machine, 3.3GHz-4 core, 3 GB RAM. SQL Server 2008R2 RTM.
I have quite the same performance and the same plans for...
August 7, 2012 at 12:59 am
Viewing 15 posts - 46 through 60 (of 78 total)