Good Source (books, Articles) For Complex Queries?

Jun 9, 2008

Hi All -

Any recommendations for good advanced t-sql books/articles? I find myself involved with writing increasingly more complex queries and after spending a few hours on some, and then searching on this site for potential answers/help, I am wondering if there might be some good books on creating more advanced/complex t-sql for real world scenarios.

Thanks
- will

View 3 Replies


ADVERTISEMENT

Books, Articles About ETL

Apr 22, 2008



Hello,

maybe anyone knows good books or articles about ETL, ETL processes, ETL optimization ?

If you know where i can download - post a link

Thanks

View 4 Replies View Related

Where I Can Get Good Articles On Indexes ?

Nov 4, 2006

Hi

where i can get good articles on indexes ?

View 2 Replies View Related

Any Good DTS Books

Sep 30, 2002

Does anyone know of any good books on DTS? I am currently using SQL 7.

Thanks in advance

View 2 Replies View Related

Any Good Books

Sep 14, 1998

Hi there,

Any good books to Know the internals of MS-SQL server 6.5

Thanks
Vivek

View 2 Replies View Related

HELP ? Good Books To Read !!

Mar 16, 1999

Sorry if this has been posted before, but I performed a search on the archives and didn't find anything !

I have just been turned over a SQL 6.5 SP3 / NT 4.0 SP3 server that has several SQL errors in the event log. I need to find a good book to read/scan, so I can get up to speed on SQL.

Thanks,

Mike Givens MCSE
mikeg@iowa.com

View 2 Replies View Related

Good SQL Server Books

Sep 26, 2006

Can anyone make some good book recommendations for SQLServer2000 other than the Microsoft BOL?
Thanks

View 11 Replies View Related

Good Books On SQL Server 2005

Feb 22, 2008

Can you guys pls suggest Good books on SQL Server 2005 ??

Thx

View 7 Replies View Related

Any Good Books For SQL Server 2000 Administration ???

Jun 5, 2003

Hi,


I am an Oracle DBA with over 7 yrs of experience.I am new to sql server 2000 and am given the responsibility of sql server 2000 production databases in a few weeks.I already have the sql server 2000 DBA survival guide.


I would like to know if there are any good books out there for

a)backup and recovery

b)General DBA tasks

c)Performance tuning.

Thanks,
Copernicus

View 4 Replies View Related

What Are Some Good Books On SQL Query Optimization And Other Advanced SQL Topics?

Aug 6, 2007

I graduated from college about three years ago and have been working as a programmer using MS SQL 2000 and even though I've learned a TON in these past three years I know there is tons more I can learn.

Because my company uses Microsoft SQL Server 2000 I'd like to focus on that, but anything ANSI-SQL is perfectly fine.

So... what are some good books on SQL query optimization and other advanced SQL topics?

Thanks in advance...

View 2 Replies View Related

Can A Log Shipping Destination DB Be Used As The Source For Transactional Replication Articles?

Aug 6, 2007

Hello,

My company is moving to a SQL Server-based packaged application early next year. We€™re planning our SQL Server architecture but have some questions that I can€™t readily find answers for. I€™m hoping someone here can point me in the right direction.

We have three servers, I€™ll call them A, B, and C. We want to duplicate all changes to certain databases on server A to server B, then duplicate changes to selected databases and tables on server B to server C.

Ideally we€™d run SQL Server 2005 Enterprise Edition on all three servers, but the packaged application vendor does not support SQL Server 2005 yet, only SQL Server 2000. Our license agreement with them does not allow us to use replication on server A. We€™re free to do whatever we want on our other SQL Servers, but server A must sit alone, untouched, like a monolith on a far-away moon. (I€™m lobbying to have the server named Tycho, or TMA2.) Stranger still, they€™re OK with log shipping from server A to other servers. We€™ve tried to explain that replication and log shipping are both core function built into SQL Server, and that if one is acceptable, then both should be. Their fear is that replication could cause performance and stability problems, and to eliminate this possibility they€™re ruling out replication on server A.

Given these constraints we€™re resigned to using SQL Server 2000 Enterprise Edition on servers A and B, and SQL Server 2005 Enterprise Edition on server C. We plan on periodically shipping logs from server A to server B and applying them at server B.

We€™d like to know if it is possible to also use transactional replication on server B to duplicate changes from server B to server C. I€™ve used log shipping and replication in the past, but never at the same time. My understanding is that a database goes into recovery mode while a transaction log is being applied and that any user changes to the database after the log has been applied will cause later log applications to fail. The scripts I€™ve seen that are used to apply the transaction logs put the database into single user mode after the log has been applied to prevent this.

This raises a few questions:



If we try to RESTORE a log to a database being used as a source for transactional replication articles, will the RESTORE fail? Or will the RESTORE start and break the transactional replication? I€™ll test this on my own, but it€™d be nice to know if anyone has already experienced this.


Is it possible for us to have a database in read-only mode serve as the source for transactional replication articles? (I can€™t imagine why not, ever though it seems counter-intuitive - why would you want to replicate transactions from a database that has no transactions?)

If the answer to number two is yes, can we suspend transactional replication on a database, RESTORE a log to the database, put the database into read-only mode after the RESTORE, and restart the replication on the database?
Thanks in advance for sharing your wisdom, everyone!

--
Thomas C. Mueller

View 1 Replies View Related

If Your Good With SQL Queries - Please Help

Apr 9, 2008

Hi, ive got some work to do on SQL queries, the scenario is below and at the bottom is my attempt at answering in the questions:
Could somebody simply tell me if the answer at the bottow are correct, if not what I have done wrong.

A local company that produces machine parts has decided to develop an in-house database system. They have identified the following tables: -

tblOrders OrderNo, CustomerNo, Date, OrderTotal

tblCustomers CustomerNo, Name, Street, Town, County, Postcode

tblParts PartNo, Description, UnitCost

tblItems OrderNo, PartNo, Quantity, ItemTotal



Create SQL queries to produce the following: -

a) Details of all orders over £1000 sorted by customer
number.

b) A list of all part descriptions and their quantities appearing on order 39

c) Delete all orders placed by customers in
Wrexham.

d) Archive all orders placed by customer Clarke into a new table called
tblArchive.

e) Increase the price of all parts whose description includes the
word “washer” by 4%.

These are my answer, which im not too sure if they are correct. If any1 could tell me if there correct or not that would be great, thanks.

a)
SELECT *
FROM tblOrders
ORDERBY CustomerNO
WHERE OrderTotal > 1000

b)
SELECT tblParts.PartNo, tblParts.Description, tblItems.Quantity
FROM tblItems INNER JOIN tblParts ON tblItems.PartNo = tblParts.PartNo;
WHERE OrderNo = 39

c)
DELETE tblOrders.*
FROM tblOrders INNER JOIN tblCustomers ON tblOrders.CustomerID = tblCustomers.CustomerID
WHERE Town = “Wrexham”

d)
INSERT INTO tblArchive
SELECT *
FROM tblOrders INNER JOIN tblCustomers ON tblOrders.CustomerID = tblCustomers.CustomerID
WHERE Name = “Clarke”

e)
UPDATE tblParts
SET UnitCost = [UnitCost]*1.04
WHERE Description LIKE “*washer” or Description LIKE “washer*” or
Description LIKE “*washer*”


Please help :)

View 1 Replies View Related

Advise About Complex T-sql Queries

Apr 6, 2008

 
Dear All,
I want to practise writing complex T sql queries in SQl Server 2005 which involve several joins, sub-queries in a single query.
This kind of queries are commonly required in Reporting scenarios where a single report may have to be prepared from 2,3 or more tables.
Presently I am able to write queries of moderate complexity.
Therefore I am looking for web tutorials, books which contains some solved examples as well as some Unsolved ones. The Unsolved ones should have the answers given so that one comes to know if he makes a mistake. The web tutorials can be from paid sites as well.
If any of you have a good collection of such queries then pls be kind enough to send it to me.I will give my email id for the purpose. If anybody can help in some other way pls let me know.
Your help will be highly appreciated.
Thanks .
 

View 3 Replies View Related

Complex TSQL Queries

Feb 21, 2007

SQL writes "Hi,

i am getting to trip with SQL Server and i find it is quite interesting.
please send me complex TSQL queries which would help me to test my SQL server expertise.
do let me know what are the URLs where i can find complex TSQL Queries
i appreciate pointers in right direction

Thanks in advance"

View 1 Replies View Related

Join 2 Complex Queries To 1

Jul 20, 2005

hi thereanyone had an idea to join following 2 queries to 1????----- QUERY 1 ---------------------------------------------SELECT TMS_CaseF_2.Name AS TCDomain_0,TMS_CaseF_3.Name AS TCDomain_1,TMS.CaseF.Name AS TCFolder_2,TMS_CaseF_1.Name AS TCFolder_3,TMS.TestCase.Name AS TCName_4,TMS_TestCase_1.Name AS TCName_5,TMS.LogFolder.Name AS PlannedLogFolder_6,TMS.Log.Name AS PlannedLog_7,TMS.CaseResult.RecordedCaseName AS TCRecordedName_8,TMS.TestPlan.Name AS Plan_9FROM((((((((((TMS.Build INNER JOIN TMS.LogFolder ON TMS.Build.UID =TMS.LogFolder.Build)INNER JOIN TMS.Log ON TMS.LogFolder.UID = TMS.Log.LogFolder)INNER JOIN TMS.CaseResult ON TMS.Log.UID = TMS.CaseResult.Log)INNER JOIN TMS.TestCase ON TMS.CaseResult.TestCase =TMS.TestCase.UID)LEFT JOIN TMS.CaseF ON TMS.TestCase.Parent = TMS.CaseF.UID)LEFT JOIN TMS.TestCase AS TMS_TestCase_1 ON TMS.TestCase.Parent =TMS_TestCase_1.UID)LEFT JOIN TMS.CaseF AS TMS_CaseF_1 ON TMS_TestCase_1.Parent =TMS_CaseF_1.UID)LEFT JOIN TMS.CaseF AS TMS_CaseF_2 ON TMS_CaseF_1.Parent =TMS_CaseF_2.UID)LEFT JOIN TMS.CaseF AS TMS_CaseF_3 ON TMS.CaseF.Parent =TMS_CaseF_3.UID)INNER JOIN TMS.TestPlan ON TMS.TestCase.TestPlan = TMS.TestPlan.UID)WHERE (((TMS.LogFolder.Name) Like 'TR1%')AND ((TMS.Build.Name)='Planning_VD10A'))ORDER BY TMS.CaseF.Name,TMS_CaseF_1.Name,TMS.TestCase.Name,TMS_TestCase_1.Name;------------------------------------------------------------------ QUERY 2 ---------------------------------------------SELECT TMS.CaseResult.RecordedCaseNameFROM ((TMS.Build INNER JOIN TMS.LogFolder ON TMS.Build.UID =TMS.LogFolder.Build)INNER JOIN TMS.Log ON TMS.LogFolder.UID = TMS.Log.LogFolder)INNER JOIN TMS.CaseResult ON TMS.Log.UID = TMS.CaseResult.LogWHERE (((TMS.LogFolder.Name) Like 'VD%')AND ((TMS.Build.Name)='VD10A IT_APP'));

View 1 Replies View Related

Datasets, Searching, Complex Queries.

Oct 3, 2007

Alright just starting out in ASP.NET and it's making my head spin, but I think I'm getting it.My schema in brief : Images, Categories, and a table in the middle so we can have a many-to-many relationship between images and categories. My issue is searching. I can search by keyword, and limit it to categories. So, in pseudo sql.. SELECT ... WHERE keyword LIKE '%test%' and category_id in (1,5,20,66); I made a variable for the keyword no problem. But how can I get this dynamic list? Or, is there another way about going this problem? 

View 6 Replies View Related

How To Perform Complex Queries Using Sqldatasource?

May 23, 2008

 Hello Friends. I have few doubts regarding the use of Sqldatasource server control. Is the control flexible enough to achieve these things:- 1.To perform complex queries using Sqldatasource.   For eg:- using JOIN to retrieve/insert data from/into multiple tables.2.Performing cascading dropdownlist using sql database as datasource.3.Performing For loops   eg:-populating the multiple items into the listbox from sqldatasource.         and retrieving them at once.4.use  ajax update  panel.etc.any  example/sample on how  to  achieve these  task?thanks.jack.                 

View 3 Replies View Related

Simplifying Queries With Complex Sub-expressions?

Dec 11, 2007

I'm dealing with queries that manages a lot of data consolidation and I'm having to repeat large blocks of code to get the desired result.
I'm wondering if that is any way to make it simple.

My queries looks like this:





Code BlockSELECT
(A + B) AS C,
(D + E) AS F,
(G + H) AS I,
(A + B) * (D + E) AS total1,
(D + E) * (G + H) AS total2,
(A + B) * (G + H) AS total3,
(A + B) * (D + E) * (G + H) AS total
FROM table





Can I somehow declare each part of the expression and make it something like this?




Code Block
SELECT
(A + B) AS C,
(D + E) AS F,
(G + H) AS I,
C * F AS total1,
F * I AS total2,
C * I AS total3,
C * F * I AS total
FROM table





Maybe it seems silly, but each sub-expression, on the real life, includes a lot of CASEs and aggragate functions and my codes are getting complex and confuse.

Since I have lots of code pieces that I repeat more than once, I would like to make it simpler.

tks for any help

View 5 Replies View Related

Good Source To Improve SQL Knowledge

Nov 26, 2007

Hi,

I've been working as a .NET developer for many years. However, my educational background isn't in IT at all, so I occasionally find that there are big gaps in my knowledge when I'm called on to do certain things.

My current role is the first one I've had where the efficiency of my database calls has needed to be top-notch. Most of my previous posts have been in building intranet functionality for medium-sized companies so it's just not been an issue and my fairly basic level of SQL knowledge has been enough to get me by.

However, I'm increasingly finding I'm needing to look stuff up, ask for help and so forth and I'm not at all sure that what I'm putting out is up to scratch. I have three main areas of concern:

1) The developers here seem to like doing a lot of the "work" of data sorting and manipulation in SQL whereas I'd previously have just grabbed the whole table and done the manipulation in .NET. I'm finding building my complex queries is just doing my head in - I'm just not used to "thinking" in the way that SQL requires which seems very different from procedural programming.

2) A lot gets said about properly indexing tables for maximum efficiency. I know what an index is and vaguely what it does, but the means of applying them to ensure the best performance is pretty much beyond me.

3) In the same manner I'm now having to worry a lot more about performance issues in my database design. I now the five normal forms and so on, but is there anything else here I need to do to maximise performance?

What I'm asking, really, is whether anyone can recommend a good source for SQL knowledge (book, site, whatever) that specifically focuses on my first problem - it'll teach me the proper way to structure my queries and think about them properly so that they don't look so damn impenetrable. It then needs to go on and address my other issues.

Any suggestions?

View 4 Replies View Related

Stored Procs And Source Safe Good Idea?

Sep 25, 2000

Hi,
Any pros and cons of putting sprocs into Source Safe?

Thanks,
Judith

View 2 Replies View Related

SQL Server 2000/2005 Tutorial For Complex And Real Life Queries

Dec 13, 2007

I am not very good in queries. Could you please suggest me some web site/Tutorial/Artical where i can get Study Material for complex and real life queries. I know the syntexes, I just need to practice queries to enhance my skills

View 1 Replies View Related

Web Service Data Source Complex Parameters

Feb 8, 2007

I am building a report that takes a web service as data source. This web service does not take primitive types as parameters. The signature is something like this:

<soap:Body>
<GetXml xmlns="myreports.ws">
<root >
<TP Name="string">
<B Name="string" Surname="string">
<SA xsi:nil="true" />
</B>
<B Name="string" Surname="string">
<SA xsi:nil="true" />
</B>
</TP>
<TP Name="string">
<B Name="string" Surname="string">
<SA xsi:nil="true" />
</B>
<B Name="string" Surname="string">
<SA xsi:nil="true" />
</B>
</TP>
</root>
</GetXml>
</soap:Body>


My question is: how do I pass the xml to the web service from reporting services.

I have seen examples with simple types. They do it with this query:

<Query>
<SoapAction>myreports.ws/GetXml</SoapAction>
<Method Namespace="myreports.ws" Name="GetXml"></Method>
<Parameters>
<Parameter Name="Parameter1">
<DefaultValue>some value</DefaultValue>
</Parameter>
</Parameters>
<ElementPath IgnoreNamespaces="True">
GetXmlResponse{}/GetXmlResult{}/diffgram{}/NewDataSet/Element{@Attribute1,@Attribute2}
</ElementPath>
</Query>

But there are no example on using xml directly instead of parameters. Can anyone help me? Where do I put my xml?



View 3 Replies View Related

Data Reader Source As ODBC / Complex Sql

May 30, 2007

Hello All,



How do I get columns to output when I have a data reader source? My connection is an ODBC and does complex sql. I am connection to a Netezza database and I would like to execute a very complex query, but in essence does



Create newtable as

(select day, sessionId)

from source

// lots of other joins and unions



select day, sessionId from newtable





drop newtable



I have an ODBC connection and I have a Datareader source, I cannot connect this source to my SQL Server destination because no output columns are available. What am I missing here?



Are there any good examples of this, taking data from a ODBC source into SQL server?



Thanks in advance.

View 5 Replies View Related

Ambiguous Complex Type Definition With XML Source. Workaround?

Jan 19, 2006

Hi,

This could well be down to my _limited_ knowledge of XSD.



I have a document and SXD supplied by 3rd party.

Both documents are valid, according to XMLSpy.

When I give the document and xsd to SSIS XML Source it complains about ambiguous complex types.



In the XML doc there is an element called Allowance that has child elements.

There is also a group which references many other elements including Allowance.

When I remove the group, SSIS stops complaining about allowance.



Would the problem stem from SSIS creating an output called Allowance ('cause of it's children), getting to the group and again, 'cause allowance has children, try create another output called Allowance.

Is my understanding of this correct? Is there a work around for a situation like this?

The only thing I can come up with is deleting the group....

Possible to alias an element? Could alias the Group > Allowance g_Allowance.



Cheers,

Crispin

View 3 Replies View Related

Dynamic Queries With Data Reader Source Adapter

Apr 16, 2008

I am a business user trying to build an incremental ETL package with SSIS. I have a working prototype on SQL Server 2005 where I select the max(ID) from the last successful run and pass that value into a variable. Then, in my Data Flow step, I select an OLE DB source adapter and use this variable in a custom select statement.

Here's my challenge....the live data is actually in a Postgres DB so I have to use a Data Reader Source adapter. When I try to pass my variable to this adapter the job bombs out. Does anyone know how to dynamically update the query text inside a Data Reader source adapter using variables or otherwise?

View 3 Replies View Related

Integration Services :: Get Data From Source By Executing Set Of Queries That Have Temp Tables

Jul 29, 2015

I need to grab data from teradata(using odbc connection).. i have no issues if its just bunch of joins and wheres conditions.. but now i have a challenge. simple scenario, i have to create volatile table, dump data into this and then grab data from this volatile table. (Don't want to modify the query in such a way i don't have to use this volatile table.. its a pretty big query and i have no choice but create bunch of volatile tables, above scenarios is just mentioned on simple 1 volatile table ).

So i created a proc and trying to pass this string into teradata, not sure if it works.. what options i have.. (I dont have a leisure to create proc in terdata and get it executed when ever i want and then grab data from the table. )

View 2 Replies View Related

Complex DB Search Forms (Store Proc Vs. Complex Where)

Nov 12, 2003

I have web forms with about 10-15 optional search parameters (fields) for a give table. Each item (textbox) in the form is treated as an AND condition.

Right now I build complex WHERE clauses based on wheather data is present in a textbox and AND each one in the clause. Also, if a particular field is "match any word", i get a ANDed set of OR's. As you can imagine, the WHERE clause gets quite large.

I build clauses like this (i.e., 4 fields shown):

SELECT * from tableName WHERE (aaa like '%data') AND (bbb = 'data') AND (ccc like 'data%') AND ( (xxx like '%data') OR (yyy like '%data%') )

My question is, are stored procedures better for building such dynamic SQL clauses? I may have one field or all fifteen. I've written generic code for building the clauses, but I don't know much about stored procedures and am wondering if I'm making this more difficult on myself.

View 7 Replies View Related

Articles Default

May 11, 2006

hi all,

I was  trying to set the articles to

"delete data in the existing table that matches the row filter"
in the publications "article>articles>table articles>snapshot" of
the publication

but everytime i reopen that property tab
the publication restore to the
default setting of "drop exisiting table and recreate it"
i"m using sql server 2000. snapshot replication--
thanks,

------------------------------------
joey

View 1 Replies View Related

Way To List All Articles

Jun 19, 2007

Is there a way in T-SQL to programmatically list all the articles? What I'm wanting to do is grab these articles and run this SP:



EXEC sp_publication_validation 'people', @rowcount_only=2, @full_or_fast=0



For each aritcle/publication, but I need a way to programmatically calculate the 'people' article in this case and pass that information along to the sp_publication_validation SP.





Is there a way, perhaps in system tables or system SP to accomplish this?





Thanks,

Phil

View 3 Replies View Related

Where To Place Articles

May 30, 2006

I have a design that includes articles that will be searched. Obviously its too slow to put them into fields, and impossible because some have photos or are otherwise html documents. So I want to put pointers to their location.

Two questions. For each deployment, both desktop and web, where is the best place to put the articles. In any folder, or only in an iis virtual folder?

dennist685

View 5 Replies View Related

Storing Articles In SQL Server

Oct 25, 2007

Hello Everyonen and thanks for your help in advance.  I am developing a conetnet management system to allow for the storage of articles within a SQL Server 2000 database.  I am using FreeTextBox as the editor for users to enter articles.  I ahve two questions.  First, many of the articles are quite lengthy and including HTML formatting go well beyond 8000 characters.  How should I go about storing these articles?  Should I use a TEXT datatype, or perhaps split the data into more than one row.  This leads to my second quuestion.  Many sites that display article type data break the artilce into multiple pages with page numbers or next links to page back and forth.  I am not sure hot to go about implmeneting this.  Any help on this topic would be greatly appreciated.  Thanks.

View 3 Replies View Related

Articles On VSS && MSSQL Server - ??

Jan 11, 2004

Hi every1,

Does anyone know where i would be able to find good articles on this subject:

-Best Practices (Logical - planning & Physical) in Setting up Database Projects for MSSQL Server 2000 with Visual Source Safe 6.0

*It would also be helpful if articles take replicated environments into consideration.

thankyou

View 3 Replies View Related

Replication Not Creating Articles

Aug 13, 2015

I'm new to replication and set up a Snapshot Replication on the tables in my sample database.  Everything seemed to work (database created on Subscriber instance, jobs set up, etc) but the articles (tables) are not being created in the subscriber's database.  

I can see the files created in the folder but I don't see the tables or the data.  Also, I confirmed that the articles are checked so they should be included.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved