Learning Optimization Techniques
Sep 14, 2006
Hi,
Still using 2000; I'm trying to figure out where to even start with optimization in SQL queries. BOL is very confusing to me on this point. I ran the following query with and without and index as seen below. Is Trace a good place to start?
DROP INDEX OrdDetails.OrderID_ind
GO
CREATE INDEX OrderID_ind
ON OrdDetails (OrderID)
GO
select count(*) from OrdDetails = 6467155 rows
GO
-- query; without index Duration 156; CPU 95; Reads 54
-- query; with index Duration 66; CPU 15; Reads 97
select OrderID, Count(OrderID) AS OrderIDCnt from OrdDetails
group by OrderID
having count(*) > 1
GO
Why are the reads more with the index? This is just a simple non-clustered index, which I believe is the default. Should I be starting elsewhere to find out this info?
thx.
Kat
View 3 Replies
ADVERTISEMENT
Apr 10, 2008
Hello Everybody,
I have a small tricky problem here...need help of all you experts.
Let me explain in detail. I have three tables
1. Emp Table: Columns-> EMPID and DeptID
2. Dept Table: Columns-> DeptName and DeptID
3. Team table : Columns -> Date, EmpID1, EmpID2, DeptNo.
There is a stored procedure which runs every day, and for "EVERY" deptID that exists in the dept table, selects two employee from emp table and puts them in the team table. Now assuming that there are several thousands of departments in the dept table, the amount of data entered in Team table is tremendous every day.
If I continue to run the stored proc for 1 month, the team table will have lots of rows in it and I have to retain all the records.
The real problem is when I want to retrive data for a employee(empid1 or empid2) from Team table and view the related details like date, deptno and empid1 or empid2 from emp table.
HOw do we optimise the data retrieval and storage for the table Team. I cannot use partitions as I have SQL server 2005 standard edition.
Please help me to optimize the query and data retrieval time from Team table.
Thanks,
Ganesh
View 4 Replies
View Related
May 21, 2008
Hello,
I apologize if this isn't the most appropriate place to ask but we have a SQL 2k server behind our website and we recently added a product review portion to our product pages. In the comments field in our db we are getting entries like:
1. Online Pharmacy, [url=http://w
2. iPb95U <a href="http://kmajvv (html tags are replaced in actual db)
My question is why the cut off? I just converted the code from escaped quotes and string concat to a stored proc using ADO params. The first entry was submitted with the sproc and the second while the string concat was still being used. So the visitor must be purposely truncating the entry, but I'm curious as to why. Is it just to try and break the code?
If anyone knows of better place to post questions like these, maybe a security forum, please let me know.
Thanks
View 4 Replies
View Related
Mar 15, 2005
Does anybody know of some good resources comparing transaction management techniques used in sql server. I am particularly interested in the areas of concurrency control, locks and recovery.
View 2 Replies
View Related
Jan 16, 2007
Some time ago, I came across some posts that suggested that remote execution of SSIS packages was only supported if the package was wrapped by a SQL Server Job Agent job.
Is this correct?
Would the web service technique described below then not be supported?
http://msdn2.microsoft.com/en-us/library/ms403355.aspx
As I understand, there are approaches for running programatically:
1. sp_start_job
2. xp_cmdshell
3. Microsoft.SqlServer.Dts.Runtime API calls
Understanding that SQL Server Job Agent is the preferred approach, please advise as to if any of the above are NOT supported by Microsoft.
Thanks,
Rick
View 4 Replies
View Related
May 18, 2007
I have worked with many data mining softwares and found SQL Data mining part of Microsoft product needs to imrove a lot to whoo the customers.
View 10 Replies
View Related
Jul 28, 2015
what are some common techniques for ensuring an isolated temp table scope? For example, if 2 different sprocs happen to crud a temp table with the same name? I'm guessing that big SQL shops establish a standard for this early on to avoid conflicts between sprocs.
View 3 Replies
View Related
Dec 1, 2006
Hello All,
I am new to this forum as well as sql. I want to learn skills with SQL. Can anyone point me to the right direction for some free pdf's/learning notes.
Thanks in advance.
sqlnewbie.....
View 5 Replies
View Related
Dec 12, 2006
Hi, not sure if this is the right place to put this but as its the beginners forum I thought I'd take a chance.
What's becoming more evident to me is my weak SQL skills. I'd like some advice on the best place to learn properly. It's starting to become a part of my role and i'm struggling a bit.
Should I go on a course? I have a number of teach yourself books and an evaluation version of the software but is this enough? I've worked through the books but struggle to apply the book to the real situation i.e subqueries
How did the more proficient of you learn SQL?
I want to get to a stage where I can help others with their SQL problems rather than always being the one helped.
Any advice much appreciated.
View 7 Replies
View Related
May 10, 2007
Hello
I am considering taking an on-line course in SQL, such as...
http://www.transcender.com/product.aspx?product%5Fid=Pak%2DMCDBACORE&dept%5Fid=100403
I do not work with SQL but I do have good computer knowledge and experience of MS Access and visual basic. Would it be plausible for me to complete such a creditation without the work experience or is it asking too much? I have a lot of time to focus on it at the minute. Does anyone have any knowledge of this particular company or can you recommend a better one?
Also, is there any way I could complete this course on a Mac (pre intel)?
Any help/info will be greatly appreciated.
Thanks
View 6 Replies
View Related
Jan 31, 2008
I am thinking about doing a computer course.It is learning about sqlto become an MCDBA.I am trying to find out how difficult this could beas I will be doing it from home and it is going to cost over £4000 forall the CD ROM's,books etc.You understand I don't want to start thecourse only to find I can't do it.I have owned my own computer for 18months and enjoy it.If anyone with experience can reply it would beappreciated.
View 4 Replies
View Related
Apr 21, 2007
I started a course and got to the lab section. It asked for a password giving me the name of student. I don't know if I was given a password when subscribing for the course. Certainly no in the confirmation email.
Where did I go wrong?
John.
View 6 Replies
View Related
Jul 26, 2006
I have four questions about Tsql language:
1. Is it important for a web developer to learn Tsql ,if he uses Data driven sites or just learn (select ,update,insert,order by ...I mean the most popular statements) ?
2. Where to learn Tsql ,is there any free books ,videos,tutorials,articles ,websites (ofcourse sql server 2005 with it's enhanced Tsql syntax?
3. Can I use a Tsql generator tool or Builder instead of learning the language ?
4. Where I can find such a tool?
If you do not know all the answers ,tell me what you know ,I will appreciate all the answers,and plz need help from the moderators also.
Thanks
View 2 Replies
View Related
Jan 1, 2007
I'm used to programming in PHP and need helping learning how to do SQL stuff in VB (using Visual Studio Pro, if that makes a difference).
For instance, in PHP I might do something like this:
//some code to connect to the database
$result = mysql_query("SELECT * FROM `table_name` WHERE `some_field` = true") OR die("ERROR: ".mysql_error());
while ($row = mysql_fetch_assoc($result)) { extract($row); //do what needs to be done with the variables}
How can I do that in Visual Basic?
This is what I have so far and that's only from cutting and pasting from some websites. 1 Using connection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True")
2 connection.Open()
3 Dim command As SqlCommand = New SqlCommand("SELECT * FROM GE_Data", connection)
4 'now how do I get to the data???
5
6 connection.Close()
7 End Using
-Mathminded
View 2 Replies
View Related
Jul 28, 2000
Any recommendation on a book for a new DBA to learn about SQL Server 7.0 replication?
View 2 Replies
View Related
Jul 8, 2000
I'm looking for a book or a couple of books to learn SQL (in general aswell as various versions from different vendors). A couple of books that would take me from beginner through advanced topics. Any good suggestions?
/ ludde@freebox.com
View 1 Replies
View Related
Apr 14, 2006
Hi, I am new to this forum. I have a question about learning SQL. I never really had much of a reason to learn anything dealing with server programs. I now would like to learn about SQL. Is there a program that anyone knows about that can help me learn?
View 7 Replies
View Related
Apr 26, 2004
Hi Guys,
Well, as a VB/VBA applications developer I'm not well prepared for this, but it looks like I will be riding herd on a production SQL Server.
TSQL I know well enough to get along, but where can I get a fast fix on all the logins, security, and process management info? Today we had a DTS package crash overnight and it took me forever to figure out that it had left half a dozen tables locked. (Note that the scripts for the DTS package are being re-written as we speak with use of transactions and NOLOCK.) Meanwhile tech support was handling a whole mess of grumpy users.
Are there any books you would recommend as resources/references? Is there a particular author who is good at writing the stuff you really need to know in English that can be read by a mere mortal like I? I am fond of the Microsoft resources/help files but I'd like to have somthing that holds highlighter and post-it flags a bit better. Not to mention something that focuses more on the beast as a whole rather than the minutia at length.
Thanks for any suggestions!
View 14 Replies
View Related
Apr 24, 2006
Hi:
I'm an aspx programer, mi database is in access.
I want to learn sql server enterprise in order to improve my aspx's and databases but I dont know where to start learning.
I have downladed a tutorial from microsoft web site but I dont know what topic learn first
SQL Server Tools
Analysis Services
Data Mining
Integration Services
Notification Services
Reporting Services
What topic I must read first? I just want make an aplication to read and update data from a database.
Do you know another good totorial on the web?
Thanks!!
View 3 Replies
View Related
Sep 9, 2006
Hi,I have been trying to register for E-Learning for MS-SQL2005 ... but IE aborts any time before the registration is finished ... (after sign-up, or information fill up, or before those steps): "Microsoft Internet Explorer a rencontré un problème et doit fermer. Nous vous prions de nous excuser pour le désagrément encouru.". I don't believe this working as designed despite this pb shows me that Microsoft has still progressed to make in quality ... (my computer is running W2K and is up to date with Windows Update).Any idea to access knowledge courses on internet for MS-SQL2005 are welcome :) Jean-Marc
View 4 Replies
View Related
Mar 21, 2007
I discovered that many of my very busy colleagues are having anextremely difficult time pulling themselves away to take vitaltraining when it requires being away for consecutive days. I justcompleted training for .NET in Chicago through a mentored learningprogram that personally helped me to tackle that same issue. Thoughthe mentored learning training allows complete interaction withclassroom version labs and interaction with an on staff expert on thetopic, it does require some discipline in that I was responsible forthe pace I was moving. The benefit for me is that I did not have tocommit myself to a set schedule of consecutive days beinginaccessible. I had the flexibility to engage in the mentoredlearning program once a week until I completed the course. Plus thementored learning lab was very comfortable and for some of mycolleagues who would are able to travel, it is near O'Hare Airport andthere is a hotel next door.Once I get more help in our data center, I do plan on spending sometime, and some of our firm's money on some instructor-led classes thatwill require me to be away for consecutive days and I can get done alot quicker. This particular training centers line-up of classes andits personnel impressed me. I thought I would alert the rest of youto this attractive alternative and would be happy to provide you thedetails on a need to know basis either through this discussion groupor you can send me an email to Join Bytes!.
View 1 Replies
View Related
Jul 20, 2005
Hi group.I have been working with ColdFusion and SQL Server for some timenow....abour 4 years I guess. I have developed various web applicationssuccessfully. The scenario I am in is that a company would like me to comeon with them as a lead database admin type guy. I would still do a little CFdevelopment....but mostly it will be data management with SQL Server.Now....like I said...I have worked with databases for quite awhile...specifically SQL Server, and I am quite comfortable with it......butIm kinda worried that the position involves a lot more than I have done.Mind you I will have first hand knowledge of the database in place which iswhat this position is for....so I have somewhat of an advantage. But....Imjust wondering if I should do a short course that teaches me the ins andouts again. It's like I develop databases by winging it. Know what I mean. Ithink I know what I am doing...but what if I don't? Just wondering what yourthoughts are.
View 6 Replies
View Related
May 8, 2006
could we download the videos of SQL Express learning resources as we can do it with the VWD, VB, C#????
there is another link to do it???
will they be available in a short future?
View 1 Replies
View Related
Jul 2, 2007
Can somebody tell me if the microsoft time series (MTS) algorithm use the unknown p approach in order to learn an ART model, cited in Autoregressive Tree Models for Time-series Analysis by Meek, Chickering and Heckerman ?
If the answer is true, what is the pmax that the MTS algorithm uses?. Is there a parameter to control this value?
If the answer is false, what approach MTS algorithm uses in order to learn the structure of a ART(p)?
Thanks for your help.
View 1 Replies
View Related
Mar 21, 2008
Hi,
I am new to SSIS.
1) I want to create a SSIS package to execute 5 stored procedures one by one. Stored procedures has parameters.
2) I want to create a SSIS package for ETL. To extract data from different tables from a database and insert into a new table in the same database on a monthly basis. How do i do these two?
Is there a good material i can go through to achieve these tasks?
Thanks in advance
View 5 Replies
View Related
Aug 13, 2004
Can anyone tell me about some good online tutorials for learning stored procedures in SQL Server 2000?
Any help will be greatly appreciated.
Thank You.
View 1 Replies
View Related
Jul 7, 2007
Hi All,
I have Oracle 9i personal edition on my laptop which I use to learn Oracle/SQL including creating and quering tables. With this I have been able to go into jobs confident with being able to query Enterprise implementations of Oracle in a commercial environment.
Now I would like to learn Microsoft/SQL and I was wondering whether Microsoft's SQL Server 2005 Express will be enough for me to learn MS/SQL like Oracle personal edition has.
Regards,
Seaweed
View 12 Replies
View Related
Sep 5, 2005
aj writes "Hi.
I'm very interested in learning SQL and SQL Server 2000. I am of above average intelligence, but have no prior programming experience. I am curious as to how long this may take to learn/establish "the basics". I apologize in advance if my question comes off as being foolish.
I've read that you're able to successfully use SQL Server 2000 without prior SQL experience. Is this true?
Ultimately, what would anyone suggest in terms of how to begin the learning (self-teaching) process? What are some good, recommended resources I may use either on-line or purchase, i.e. video tutorials, books, software, etc, etc. Any info or assistance would be greatly appreciated. I've run across an SQL Server 2000 tutorial video online and am considering purchasing it. The demo clips seemed well organized.
I appreciate any advice, suggestions, and recommendations.
Please feel free to email me directly.
Thanks!
- Struggling newbie
View 2 Replies
View Related
Dec 1, 2006
I'm pretty familiar with SQL syntax. I am interesting in learning more of admin information.
I've got a lot to learn here and would like some discussion and/or links to helpful sites.
One of the most important things:
I'm trying to understand how the heirachry of groups and users work better. I noticed it is integerated with our active directory from windows server 2000. Is this just becuase of I choose intergrated security when I installed this?
I have many other questions but I would like to try and understand one thing at a time before moving on, so somebody encourage this discussion with me!
View 1 Replies
View Related
Dec 5, 2007
Hi,
Can any body tell me how can I learn about Sql. I am now a days learning asp.net using C#. bUT can not under stand how to work with database.
Can any body tell me the online book that is easy to learn (Examples etc ).
Feejaz.
Navi
View 6 Replies
View Related
Dec 31, 2007
I am using the book SQL Server 2005 Analysis Services by Reed Jacobson and Stacia Misner Step by Step.
For building My First Cube, in the Cube Wizard, when the Radio button is checked for "Build the cube without using a data source", the Checkbox for "Use a cube template" is dimmed.
How do you remove the dimming so that the database "Adventure Works Standard Edition" can be entered for providing the template.
I find two files of Adventure Works in Visual Studio 8Microsoft.NET Framework... and three more Adventure Works files in in Visual Studio 8SDK....
Somehow the Adventure Works is not in the right path?
Thanks in advance for some help.
Norman Snowden
View 1 Replies
View Related
Jul 23, 2005
I am a retailer whose software back-end has just been upgraded from Accessto SQL Server 2000. (The front-end is an independently-written shop Point OfSale system)While I know a fair bit about computers, I know nothing about SQL Server.And frankly, I don't want to know much. I don't need to build any newdatabases, program SQL, or "be an administrator". All I need to know aboutis how to go into the raw data like I did in Access and change that data.(The front-end software has some limitations, and I have found it easier inthe past to go into the dB through Access and search-and-replace, andgenerally edit the data as though I was in Excel).What is the easiest and quickest way to learn the skills I need for doingthe same thing under SQL Server 2000?Is there a particular book or site that you could recommend?Is there in fact a tool in existence that mimics Excel in the editing of SQLdata??
View 7 Replies
View Related
Oct 18, 2006
Hello, I am experimenting with indexes and hope people can shed lighton some of my problems.I am using SLQ 2000 on Win 2000 Server. Using the following query fordiscussion;--------------------------------SELECT TOP 1000000E.EUN_Numeric, -- Primary KeyE.EUN_CODE, -- VarCharE.[timestamp] --,--E.Model -- Computed column (substring of EUN_CODE)FROM dbo.Z1_EUNCHK E--WHERE E.[timestamp]DATEADD ( wk , -48, getdate() ) AND-- E.[timestamp]< DATEADD ( wk , -4, getdate() )ORDER BY E.[timestamp] DESC-----------------------------------Problem 1) If I set up a single Index on the TimeStamp (plus the PK onEUN_Numeric) then there is not improvement in performance.It is only when I set up an Index on the Timestamp,EUN_Numeric,EUN_Codethen I get a good improvement. This is also thecase with the "where" clause added. I am using query analyser. Theimprovement is 14 secs to 3 secs (mainly with the removal of the sortprocess)Why?My expectation is that if my query uses [timestamp] column then surelyan index only on this is adequate.Problem 2) Introducing the simple computed column into the query takesthe time to 15 secs (with Sort processes involved).Why does revert back to sorting process when previous the index wasused ?Regards JC......
View 6 Replies
View Related