Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Monday, March 26, 2012

How to save a Database project using DTE?

Hi All,

How can we save a Database project (not a SQL Server project) using Application Object Model? I was able to save a SQL Server project using the DTE like this:

Project project = null;
Solution solution = _applicationObject.Solution;
foreach (Project prj in solution.Projects)
{
if (prj.Name.Equals(projectName))
{
project = prj;
break;
}
}
if (project != null)
{
project.Save(project.FileName);
}

But for an Oracle Database project it gives an exception saying that Save() method is not implemented in DTE. A similar kind of problem occured for me when I tried to add an item to a Oracle Database project using DTE.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=495993&SiteID=1

Can anybody give me a hint to find a solution for this?

Best regards,
Imesh

Sorry, generic database projects don't implement DTE.

However, there is a workaround using the base ide. in your macro code, you need to make the solution explorer that active tool window, and then navigate down to the project node and select it. Then run

DTE.ExecuteCommand ("File.SaveSelectedItems")

That should do it.

|||Thanks Kenneth! I will try that out..!

Best regards,
Imesh

Friday, March 23, 2012

How to run SSIS package

How can I:

1) Create a Job in 2005 to run my SSIS project? Specifically syntax and where I would place the all in the job's properties

2) Can I run an SSIS package from the command prompt? what would be the syntax

You should read BOL as it has extensive information on these topics.

1) ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/541ee5ac-2c9f-4b74-b4f0-13b7bd5920b0.htm

This is general info on agent and you would use the SSIS subsystem for running SSIS packages.

2) ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlcmpt9/html/89edab2d-fb38-4e86-a61e-38621a214154.htm

Matt

|||this is a dumb question but how do I run those paths to get to your URLs above?|||Open BOL and put the URL into the URL box.

how to run sql log shipping manually

Hi everyone

In my project, sometimes, I need to run log shipping manually rather that it runs automally when the schedule occured.

manually run log shipping means call the log shipping in code.

Thanks.

Are you using SQL2000 or SQL2005?

====================
For SQL2000, log shipping usesSqlmaint.exe to back up and to restore databases. When SQL Server creates a transaction log backup as part of a log shipping setup, Sqlmaint.exe connects to the monitor server and updates the log_shipping_primaries table with the last_backup_filename information. Similarly, when you run a Copy or a Restore job on a secondary server, Sqlmaint.exe connects to the monitor server and updates the log_shipping_secondaries table.

====================

Fro SQL2005,?after we enable and configure log shipping for the specific database in SQL Server 2005, several agent jobs are created to maintain a series of steps for log shipping. Generally, this includes a backup job for primary server, a copy and a restore job for secondary server and an alert job for monitor server.

While SQL Agent is running, the job invocation engine monitors the schedule and prepares to launch the job next time. Then, the job manager fetches the detailed steps of the active job from msdb tables and executes it. As for the backup/copy/restore jobs, they involve cmdshell subsystem to launch the external executable sqllogship.exe (SMO application) to finish the specific tasks. Sqllogship.exe will update the information in log_shipping_monitor_primary, log_shipping_monitor_secondary, log_shipping_monitor_history_detail, and log_shipping_monitor_error_detail tables on primary or secondary server. This is implemented by running some undocumented log shipping stored procedures in master database, including:

sp_MSadd_log_shipping_history_detail

sp_MSadd_log_shipping_error_detail

and directly modify those correlated columns in log_shipping_monitor_primary, log_shipping_monitor_secondary tables.

At the end of the specific task in each sqllogship.exe execution, SQL Server will issue a series of steps to synchronize the information between primary/secondary server and the monitor server. This is also implemented by running some undocumented log shipping stored procedures in master database, including:

sp_processlogshippingmonitorprimary

sp_processlogshippingmonitorsecondary

sp_processlogshippingmonitorhistory

sp_processlogshippingretentioncleanup

If the monitor server is a remote machine to the SQL box where the sqllogship.exe is running, a distributed query for these sprocs with linked server built in-house is being used to update the info on the remote monitor server.

Next, when each job is finished, the correlated job history info is recorded in the msdb tables by the SQL Agent.|||your answer is very nice, thank you very much !Smile|||I'm glad that I can helpSmile Happy new year my friend!sql

How to run Search on 800,000 records

Hi !!

We are doing a project where we have a table with 800,000 records. We need to implement a search on this 800,000 records. How do we do that?

Assue State = NJ

Criteria: Select County, Select City, Enter Zip Code, First Name and Last Name

This should bring up Information about the person.

How can we implement it efficiently ?

Thanks

Things that will increase performance of a query with a lot of records:

- More CPU power / Ram / faster hard drives on the database server

- Proper use of indexes on the affected table.

- Use of stored procedures or other method that results in only the specific page of the record you are looking for being sent from the database server to the web server - for example -- if you wanted records 1-10 of a 800,000 record query, make sure whatever method you use only returns 10 records.

The web sitesql-server-performance.com has an abundance of tips that might help.

Jason

|||

Jason,

We have dedicated Database sevrer with good RAM, CPU, HDD etc.

Its like people search ...

I showed you my selection/search criteria. Based on that Criteria, we will get 1 or more records. I don't want Query to take long time.

Where should we have our indexes? How can we write query

For eg. Query Like this will Help us?

SELECT ContactInfoID, FirstName, LastName, HouseNo, StreetName, City, State, Zip, County, Municipality, HomePhone
FROM ContactInfo
WHERE County = COALESCE(@.County, County) AND
City = COALESCE(@.City, City) AND
Zip = COALESCE(@.ZipCode, Zip)AND
FirstName = COALESCE(@.FirstName, FirstName) AND
LastName = COALESCE(@.LastName, LastName)

|||

Hello,

Basically if that's the query that generates the results you want, than that's the query you should use. Focus on getting the results you want first, then use the "Index Tuning Wizard" with your query in SQL Query Analyzer to determine what indexes would be helpful.

Jason

|||

Hey !!

I indicated one of the query.. if there is a better way to query I would like to know that .

If we have multiple people with this query, we ask one more question like DOB and that will narrow down records.

|||

Basically you need to figure out which queries you'll most commonly be doing against this table of your database. As you mentioned you'll supply info as you have it, dob etc.. but are their some fields that you'll almost always be using? If so definitely place indexes on these fields this will speed up your query performance. If you find there's one that you use predominantly i would make it a clustered index which will further speed up your performance.

Also, I would write my application query as best you can, try not to use double wildcards ie (select * from table where myfield = '%somevalue%') queries like this will blow the indexes and do full table scans. If you place an index across more than one field if you do not always query it by the fields in your index this also "blows" the index and will result in a full table scan. Moral of the story, use the indexes as you create them (in the same fashion etc..)

Once your app is built, i would use sql profiler to watch the queries, be sure to grab the query plans from sql profiler. Anywhere that it says FULL Table Scan, go back and apply an index if possible to eliminate these full table scans.

Hope this helps

|||

If these are the results you are looking for, then there is no better query! :) If these aren't the results you are looking for, then the simplest query (uses the least functions, joins, etc) that returns the least # of results is the best.

Jason

|||

Open the Database then click on tools then click on wizards, then Index tuning wizard it will give you hints on indexes you need on the table. Make the size of your clustered index small and you can create 249 none clustered indexes on the table. The wizards tool is context sensitive you may not see it if your database is not open. Hope this helps.

Kind regards,

Gift Peddie

|||

I have read the article and implemented the Dynamic Sql. We are giving users capability of Ad Hoc Query on 800,000+ records. Sometime query takes long time to return results and we have time out issue. OR sometime return results are too many (150,000) records.

We have designed Ad Hoc Query tool with idea of

http://www.aspose.com/Products/Aspose.AdHoc/Demos/

Since it is Dynamci SQL I can't have indexes. Can someone help how to reduce execution time on Dynamic SQL?

Our Dynamic SQL Looks like this

CREATE PROCEDURE TEST

(

@.whereClause varchar(4000)

)

DECLARE @.sql varchar(2000)

SET @.sql = 'SELECT FirstName, LastName, Address, City, State, Zip, County, Township, Phone

FROM VotersProfile

WHERE + ' @.whereClause

"whereClause" is build into C# code based on the columns user select in Tool

For eg @.whereClause is FirstName = 'John' AND 'County = 'Bergen' AND (Gender = 'M' OR Gender = 'F')

Can partitioned view or some other technique can help me? Its like search.. can we you some other search techniques?

Thanks

|||Tip: Use FieldName IN('Value1', 'Value2') instead of multiple ANDs...|||

Ok, let's see...

Sometime query takes long time to return results and we have time out issue. OR sometime return results are too many (150,000) records.

Your problem, really. If you get too many results, limit the number of results you get. Say you want to only get 500 rows, limit the returning rows to 501 - fif you get 501 tell the user "more than 500 items were returned" and be done. One of the clasical SQL problems - people not limiting their results to what they need.

If query processing takes too long then put indices on the table, and/or normalize the data into multiple tables.

Since it is Dynamci SQL I can't have indexes.

Ok, where exactly did you get this idea? The whole genius idea of SQL databases was that you define query and indices separatly and that the query analyzer can then decide which indices to use or not to use. In the times before SQL people had to manually select which indices to use (in which order).

That you can not have indices as you use dynamic SQL is silmply not true. Get a beginner book about SQL and read it. Actually you CAN have as many indices as you want, and the system will use as many as it thinks make sense (sometimes an arguable decision).

Now, going down to your problems....

There is a lot you can do to speed up your queries. First, do you use the proper database structure? For a fully query optimized system I would propably use four to six different tables, at elast to identify a person, putting it into NF5 (5th normal form) This would significantly cut down the size of the data and make processing much faster, by having less string comparisons. It is a terrible mess to update then on most databases, but on SQL Server an instead of update query on a view can handle the updates nicely without the obvious use of a stored procedure.

Then, second, can you identify "main query parameters"? Given your six parameters - are there some people will always use? This can be important for the main selection axis for the indices.

Or, just being lazy, run 10000 queries and just let query analyzer make recommendations. It is not perfect, though.

Your static SQL Statement that you gave, though, is a classical beginner mistake example:

WHERE County = COALESCE(@.County, County) AND
City = COALESCE(@.City, City) AND
Zip = COALESCE(@.ZipCode, Zip)AND
FirstName = COALESCE(@.FirstName, FirstName) AND
LastName = COALESCE(@.LastName, LastName)

See, the problem is your use of "Coalesce" and the field on the right side. Take "City =COALESCE(@.County, County)". This statement needs to be evaluated for every row, despite of whether @.City has a value or not. In order to optimize this out, SQL Server's Query optimizer would have to identify that:

* Coalesce returns the same value for the same type of input. It propably can do it. NOte though that this would mean one evaluation for every different city name stored, at least.

* Coalesce returns the same value regardless of the field entered (second parameter) if @.City is not null. Now, it definitly does not do this.

Result: brutally said you force a table scan.

Beginner rule: try to formualte your queries in such a way that database row fields only appear on ONE side of the condition (normally the left one) and do not involve ANY processing.

You break the rule by having field references in both sides, which results in the same logic, logically, ut it forces a table scan and makes any index totally useless.

And it does so because you do not use dynami SQL. Static SQL and dynamic query conditions simply to not match.

I can see you already got rid of this in the dynamic SQL you use (shown later).

Well, all I can suggest then I do dump the table and come up with a normalized form. Last time I had to do something like this we reduced the database size by about 50% and performance really screamed up. Keeping all the data in one table does not follow proper procedures for query optimized databases - that simple. The data is not normalized. Not being normalized the query otimizer is really limited in what it can do.

|||

Thanks for the suggestions. Our problem is Voters Profile table is coming to us every year from Political Parties. They have same structure. As a result we can't normalize it.

Table has about 25+ columns:

In case of GXX G=General Voting XX = Year and PXX P=Primary Voting XX = Year

We created 2 computer columns G00_04 & P00_04 i.e. How many times person voted in last 4 yrs

FirstName, LastName, Address1, Address2, City, State, Zip, Zip4, County, Township, district, ward, HomePhone, Ethinicity, Gender, DOB, Age, Registered Party, VotingID, MailID, G04, P04, G03, P03, .... G96, P96, VotingHistory

Out of this we gave user to do "Adhoc Search" based on any or all combination of County, Township, Zip, Gender, Age, General Voting and Primary Voting

In the Result Set we display Name, Address, city, State, Zip, HomePhone, General Voting and Primary voting

As I meantioned Where Clause is composed in C# code and passed to Dynamic SQL

CREATE PROCEDURE TEST

(

@.whereClause varchar(4000)

)

DECLARE @.sql varchar(2000)

SET @.sql = 'SELECT FirstName, LastName, Address, City, State, Zip, County, Township, Phone, G00_04, P00_04

FROM VotersProfile

WHERE + ' @.whereClause

So if they Select only County is Where Condition

@.whereClause = 'County = ''Atlantic''' and result may be 90000 records.

But if they add some more condition like 1) Age Between 25 and 35 2) Gender = M etc they get less records as query is more specific.

We need general way to optimize the performance. I know the COALESCE but, if some values are NULL they will not show up in result set.

Reading the Dynamic SQL articles we decided to follow them and implement it. Now, we need to know how to do performance tunning.

I have seen that some query result into 4 table scan. How can we reduce that.

I hope this should help to understand our problem and giving suggestion !!

Thanks,

|||Why not use DTS to take the supplied data and normalize it upon import? That way your queries will execute faster. :)
Jason
|||

Our need is growing from 800K records to 4 million record. Is there a better way to search ?

How about Partitioned view/table ?

|||Change your table layout to 5th normal form.

How to run parallely/sequentially

I am having different packages under one project. Each package is having one one control flow, which internally contains one data flow. I want to run these data/control flows in one sequence. I am not able to drag all of these data/control flows into one sequence container. Could anyone tell how to do this in SSIS?

I would create a controller a package, and use Execute Package Tasks to call the existing worker packages. Do not constrain the Execute Package tasks and they will execute in parallel.

|||I didn't get it.

My question is how to run different packages sequentially or parallely. e.g I am loading customer dimension in one data flow(one package). Then I am loading parts dimension using one more package. Then I am loading Calendar Dimension using another package. How do I combine these in a single process flow/workflow, so that one flow can run after/with another .|||You haven't given any details of the workflow you want, so I'll just guess. If I have two dimension load packages and one fact load package I would load my dimensions in parallel, but would want my facts to load after all dimensions for example.

So I would create a new package, the controller package, and add an Execute Package Task to call my Dim 1 package. Then add a second Execute Package Task for my Dim 2 package. Then add a third Execute package task for my Fact package. Now drag and drop the workflow (green dangling lines) from the Dim 1 Exec Pkg Task to Fact Exec Pkg task. Repeat for Dim 2 to Fact.

So now the dimensions are unconstrained and will execute in parallel, but the fact will wait for both dimensions to complete successfully.
Dim1Fact
Dim2||||Thanks DarrenSQLIS, I got it|||The execute package task is working. but when I run my sequence container, which contains 3-4 execute package tasks--it opens up each and every pacakge on my screen (while running). what do I need to do, if I don't want to open them. I want to execute this sequence, without opening up each and every package..|||That's just what the debugger does. If you run it with dtexec (Ctrl-F5) that won't happen. But then you won't get them purty colors. Smilesql

Friday, March 9, 2012

How To Retrive Data If There Are Large No. Of Datas In Table(by Minimum Time Conusum

MY PROJECT IS HOSPITAL MANAGEMENT SYSTEM
AND THERE ARE ABOUT 700 PATIENT DAILY VISIT THE HOSPITAL/ ADDING NEW PATIENT(LARGE HOSPITAL).
SO, LARGE NUMBER OF PATIENTS ARE THERE. NOW SUPPOSE AFTER FEW YEARS THERE ARE ABOUT 70000000 PATIENTS RECORDS IN DATABASE , THEN TO FETCHNIG SOME PATIENT'S DETAILS IS VERY TIME CONSUMING [ BY SELECT * FROM PATIENT]
THEN WHAT SHOULD I DO? ANY ONE HAVE ANY IDEA?

AND ONE MORE THING I WOULD LIKE TO KNOW THAT HOW THE IMAGES WILL STORE IN DATABASE ACCESS?
PLS REPLY SOON

RAHUL PRAJAPATI
rahul_nadiad@.yahoo.com

Quote:

Originally Posted by RAHULPRAJAPATI

MY PROJECT IS HOSPITAL MANAGEMENT SYSTEM
AND THERE ARE ABOUT 700 PATIENT DAILY VISIT THE HOSPITAL/ ADDING NEW PATIENT(LARGE HOSPITAL).
SO, LARGE NUMBER OF PATIENTS ARE THERE. NOW SUPPOSE AFTER FEW YEARS THERE ARE ABOUT 70000000 PATIENTS RECORDS IN DATABASE , THEN TO FETCHNIG SOME PATIENT'S DETAILS IS VERY TIME CONSUMING [ BY SELECT * FROM PATIENT]
THEN WHAT SHOULD I DO? ANY ONE HAVE ANY IDEA?

AND ONE MORE THING I WOULD LIKE TO KNOW THAT HOW THE IMAGES WILL STORE IN DATABASE ACCESS?
PLS REPLY SOON

RAHUL PRAJAPATI
rahul_nadiad@.yahoo.com


Hi there,

The structure of the database isteslf can play a major role is enabling fast access, heard of database normalization? Why not use database normalization to restructure your current database.

In relational database theory, normalization is the process of restructuring the logical data model of a database to eliminate redundancy, organize data efficiently, reduce repeating data and to reduce the potential for anomalies during data operations. Data normalization also may improve data consistency and simplify future extension of the logical data model. The formal classifications used for describing a relational database's level of normalization are called normal forms

Kindly refer to below link for further reading & understanding, hope it helps.

http://en.wikipedia.org/wiki/Database_normalization
You can use Binary large object (BLOB technique in order to be able to safe graphics and other related material in database.

Good luck & Take care.|||Hi Sashi,
I am also a newbie to these things.
My understanding is that, data normalization eases the adding the data and managing the constraints.
But normalisation results in more number of tables than without (or lower level of) normalisation.
So doesnt it mean that it slows the data access as it requires to join more number of tables.

Please correct me if I am wrong.

-Subhash.

Quote:

Originally Posted by sashi

Hi there,

The structure of the database isteslf can play a major role is enabling fast access, heard of database normalization? Why not use database normalization to restructure your current database.

In relational database theory, normalization is the process of restructuring the logical data model of a database to eliminate redundancy, organize data efficiently, reduce repeating data and to reduce the potential for anomalies during data operations. Data normalization also may improve data consistency and simplify future extension of the logical data model. The formal classifications used for describing a relational database's level of normalization are called normal forms

Kindly refer to below link for further reading & understanding, hope it helps.

http://en.wikipedia.org/wiki/Database_normalization
You can use Binary large object (BLOB technique in order to be able to safe graphics and other related material in database.

Good luck & Take care.

Friday, February 24, 2012

How to retrieve data from query and link the data to a data number?

i'm doing a project on SQL Server 2005, i'm stack in searching the data and can't link the data in the data number.. can someone help mi with the programming code? as i can search for the words in the table but i can't link with the data number..

am i doing the correct thing? this command will search for the keyword LIVER. or issit this command? i doing half way through..

SELECT Omim_No

FROM av

WHERE Description LIKE '%LIVER%'

ORDER BY Omim_No ASC

SELECT Omim_No

FROM cs

WHERE CS_Description LIKE '%LIVER%'

OR CS_DATA LIKE '%LIVER%'

ORDER BY Omim_No ASC

SELECT Omim_No

FROM ti

WHERE Omim_Titles LIKE '%LIVER%'

ORDER BY Omim_No ASC

SELECT Omim_No

FROM ti_alt_title

WHERE Omim_Alt_Titles LIKE '%LIVER%'

ORDER BY Omim_No ASC

SELECT Omim_No

FROM tx

WHERE Omim_Text LIKE '%LIVER%'

SELECT subsnp_id,pop_id,allele_id

FROM AlleleFreqBySsPop

WHERE source LIKE '%LIVER%'

SELECT aln_id

FROM b125_Alignments_35_1

WHERE tr_acc LIKE '%LIVER%'

OR ctg_name LIKE '%LIVER%'

OR ctg_acc LIKE '%LIVER%'

OR tr_orient LIKE '%LIVER%'

SELECT ctg_id,exon_number,exon_start,exon_end

FROM b125_ContigExon_1_1

WHERE mrna_acc LIKE '%LIVER%'

SELECT ctg_id,exon_number,exon_start,exon_end,seg_start,seg_end

FROM b125_ContigExon_35_1

WHERE mrna_acc LIKE '%LIVER%'

SELECT b125_ContigInfo_1_1.*

FROM b125_ContigInfo_1_1

WHERE contig_acc LIKE '%LIVER%'

OR contig_name LIKE '%LIVER%'

OR contig_chr LIKE '%LIVER%'

OR group_term LIKE '%LIVER%'

OR group_label LIKE '%LIVER%'

OR contig_label LIKE '%LIVER%'

SELECT b125_ContigInfo_34_3.*

FROM b125_ContigInfo_34_3

WHERE contig_acc LIKE '%LIVER%'

OR contig_name LIKE '%LIVER%'

OR contig_chr LIKE '%LIVER%'

OR group_term LIKE '%LIVER%'

OR group_label LIKE '%LIVER%'

OR contig_label LIKE '%LIVER%'

SELECT b125_ContigInfo_35_1.*

FROM b125_ContigInfo_35_1

WHERE contig_acc LIKE '%LIVER%'

OR contig_name LIKE '%LIVER%'

OR contig_chr LIKE '%LIVER%'

OR group_term LIKE '%LIVER%'

OR group_label LIKE '%LIVER%'

OR contig_label LIKE '%LIVER%'

SELECT b125_CrashedInfo.*

FROM b125_CrashedInfo

WHERE snp_type LIKE '%LIVER%'

SELECT b125_MapLink_35_1.*

FROM b125_MapLink_35_1

WHERE snp_type LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_MapLinkInfo_35_1.*

FROM b125_MapLinkInfo_35_1

WHERE accession LIKE '%LIVER%'

SELECT b125_ModelInfo_35_1.*

FROM b125_ModelInfo_35_1

WHERE tr_acc LIKE '%LIVER%'

OR donor LIKE '%LIVER%'

OR acceptor LIKE '%LIVER%'

OR alignment LIKE '%LIVER%'

SELECT b125_ProjectedSNP_35_1.*

FROM b125_ProjectedSNP_35_1

WHERE snp_type LIKE '%LIVER%'

SELECT b125_ProteinInfo_34_3.*

FROM b125_ProteinInfo_34_3

WHERE ref_seq_status LIKE '%LIVER%'

OR rna_accs LIKE '%LIVER%'

OR prot_accs LIKE '%LIVER%'

OR nucl_accs LIKE '%LIVER%'

SELECT b125_ProteinInfo_35_1.*

FROM b125_ProteinInfo_35_1

WHERE ref_seq_status LIKE '%LIVER%'

OR rna_accs LIKE '%LIVER%'

OR prot_accs LIKE '%LIVER%'

OR nucl_accs LIKE '%LIVER%'

SELECT b125_SNPContigLoc_34_3.*

FROM b125_SNPContigLoc_34_3

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_SNPContigLoc_34_3_dup.*

FROM b125_SNPContigLoc_34_3_dup

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_SNPContigLoc_34_3_fix.*

FROM b125_SNPContigLoc_34_3_fix

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_SNPContigLoc_35_1.*

FROM b125_SNPContigLoc_35_1

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_SNPContigLoc_35_1_ss.*

FROM b125_SNPContigLoc_35_1_ss

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_SNPContigLoc_35_1_ss_fixed.*

FROM b125_SNPContigLoc_35_1_ss_fixed

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT b125_SNPContigLocusId_1_1_temp.*

FROM b125_SNPContigLocusId_1_1_temp

WHERE contig_acc LIKE '%LIVER%'

OR locus_symbol LIKE '%LIVER%'

OR mrna_acc LIKE '%LIVER%'

OR protein_acc LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

OR residue LIKE '%LIVER%'

OR build_id LIKE '%LIVER%'

SELECT b125_SNPContigLocusId_34_3.*

FROM b125_SNPContigLocusId_34_3

WHERE contig_acc LIKE '%LIVER%'

OR locus_symbol LIKE '%LIVER%'

OR mrna_acc LIKE '%LIVER%'

OR mrna_ver LIKE '%LIVER%'

OR protein_acc LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

OR residue LIKE '%LIVER%'

OR build_id LIKE '%LIVER%'

SELECT b125_SNPContigLocusId_35_1.*

FROM b125_SNPContigLocusId_35_1

WHERE contig_acc LIKE '%LIVER%'

OR locus_symbol LIKE '%LIVER%'

OR mrna_acc LIKE '%LIVER%'

OR mrna_ver LIKE '%LIVER%'

OR protein_acc LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

OR residue LIKE '%LIVER%'

OR build_id LIKE '%LIVER%'

SELECT b125_SNPContigLocusId_35_1_old.*

FROM b125_SNPContigLocusId_35_1_old

WHERE contig_acc LIKE '%LIVER%'

OR locus_symbol LIKE '%LIVER%'

OR mrna_acc LIKE '%LIVER%'

OR mrna_ver LIKE '%LIVER%'

OR protein_acc LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

OR residue LIKE '%LIVER%'

OR build_id LIKE '%LIVER%'

SELECT b125_SNPMapInfo_34_3.*

FROM b125_SNPMapInfo_34_3

WHERE snp_type LIKE '%LIVER%'

OR assembly LIKE '%LIVER%'

SELECT b125_SNPMapInfo_34_3_fix.*

FROM b125_SNPMapInfo_34_3_fix

WHERE snp_type LIKE '%LIVER%'

OR md5 LIKE '%LIVER%'

OR assembly LIKE '%LIVER%'

SELECT b125_SNPMapInfo_35_1.*

FROM b125_SNPMapInfo_35_1

WHERE snp_type LIKE '%LIVER%'

OR md5 LIKE '%LIVER%'

OR assembly LIKE '%LIVER%'

SELECT b125_SNPMapInfo_35_1_ss.*

FROM b125_SNPMapInfo_35_1_ss

WHERE snp_type LIKE '%LIVER%'

OR md5 LIKE '%LIVER%'

OR assembly LIKE '%LIVER%'

SELECT b125_WithdrawCandidates.*

FROM b125_WithdrawCandidates

WHERE subsnp_id LIKE '%LIVER%'

SELECT Batch.*

FROM Batch

WHERE handle LIKE '%LIVER%'

OR loc_batch_id LIKE '%LIVER%'

OR loc_batch_id_upp LIKE '%LIVER%'

OR batch_type LIKE '%LIVER%'

OR moltype LIKE '%LIVER%'

OR synonym_type LIKE '%LIVER%'

OR linkout_url LIKE '%LIVER%'

SELECT BatchCita.*

FROM BatchCita

WHERE citation LIKE '%LIVER%'

SELECT BatchCommLine.*

FROM BatchCommLine

WHERE line LIKE '%LIVER%'

SELECT BatchCultivar.*

FROM BatchCultivar

WHERE line LIKE '%LIVER%'

SELECT BatchMeExLine.*

FROM BatchMeExLine

WHERE line LIKE '%LIVER%'

SELECT BatchPrivLine.*

FROM BatchPrivLine

WHERE line LIKE '%LIVER%'

SELECT BatchStrain.*

FROM BatchStrain

WHERE line LIKE '%LIVER%'

SELECT BatchValCode.*

FROM BatchValCode

WHERE batch_id LIKE '%LIVER%'

SELECT chk_SNPContigLoc_35_1.*

FROM chk_SNPContigLoc_35_1

WHERE snp_type LIKE '%LIVER%'

OR phys_pos LIKE '%LIVER%'

OR allele LIKE '%LIVER%'

SELECT chk_SNPMapInfo_35_1.*

FROM chk_SNPMapInfo_35_1

WHERE snp_type LIKE '%LIVER%'

OR md5 LIKE '%LIVER%'

OR assembly LIKE '%LIVER%'

SELECT Contact.*

FROM Contact

WHERE handle LIKE '%LIVER%'

OR name LIKE '%LIVER%'

|||

Please tell me this is not one command ? It's huge.

At it's core, what you're doing is right, using the LIKE keyword.

|||how to link a result to a number? i mean inside the table..|||

I don't understand. You're selecting from multiple tables. Don't those tables have ID columns ? Can't you use those ?

|||i wan to search for the word and it will display the Omim number and the Omim number will link to another identical number to display the description.. can u do it?|||

Nothing you're saying makes sense to me. You're selecting multiple tables ? why can't you just use the same ID, isn't that what you're saying you want ?

|||because some tables inside contain only numbers so i have to search for the keyword and display the result(omim number) and link this result number to a table contain numbers must be identical numbers. it is so hard that i can't really explain well sorry.. my tasks is hard..|||

I'm sorry, I do not understand the question. What do you want to do ?

|||

first thing is how to search the keywords from the tables

Second thing after u search the result ,how to link the result to a number related to the result?

|||

you use the LIKE keyword to find data inside strings. You return the ID with the string in the query.

|||can u show an example? i wan to search from the whole tables.. will the code be very long?|||

I can't show you an example because I don't know the table schema you're using. You want SQL, right ?

select id, name from tblSomething where name LIKE '%text%'

|||

SELECT av.*,cs.*,ti.*,ti_alt_title.*,tx.*,AlleleFreqBySsPop.*,OmimVarLocusIdSNP.*

FROM av,cs,ti,ti_alt_title,tx,AlleleFreqBySsPop,OmimVarLocusIdSNP

WHERE

av.Omim_No = cs.Omim_No

AND av.Omim_No = ti.Omim_No

AND av.Omim_No = ti_alt_title.Omim_No

AND av.Omim_No = tx.Omim_No

AND av.Omim_No = OmimVarLocusIdSNP.omim_id

AND (

Description LIKE '%LIVER%'

OR CS_Description LIKE '%LIVER%'

OR CS_DATA LIKE '%LIVER%'

OR Omim_Titles LIKE '%LIVER%'

OR Omim_Alt_Titles LIKE '%LIVER%'

OR Omim_Text LIKE '%LIVER%'

)

how?

|||

What's wrong with this ? It will return all the data you could hope for. Do you want to generate new IDs, unique to the query and not in the DB ?