Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Monday, March 26, 2012

How to save Excel spreadsheet in SQL Database

I need to understand how I can save an excel spreadsheet in the SQL 7.0 db.
Am I trying to save the XLS file or just a link to it' I have a VB6 front
end to the SQL database.
ThanksYou're probably better off saving a link to the XLS, depending on what
you're doing with it in your application. The links are easier to
store and retrieve and you don't have to deal with the overhead of
storing and retrieving large binary objects in your database.
-- Mary
MCW Technologies
http://www.mcwtech.com
On Fri, 23 Jan 2004 12:31:43 -0600, "ddg1950" <dgoncher@.clearlam.com>
wrote:
quote:

>I need to understand how I can save an excel spreadsheet in the SQL 7.0 db.
>Am I trying to save the XLS file or just a link to it' I have a VB6 fron
t
>end to the SQL database.
>Thanks
>

Friday, February 24, 2012

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

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?can u send mi the code by e mail? futaba2@.hotmail.com thx alot..|||can anyone help mi with this? how to add more tables ? now i got 2 tables
join together what if i want tojoin more tables, how should i do? add
command on which line?
SELECT av.Omim_No
FROM av
INNER JOIN cs
ON av.Omim_No=cs.Omim_No
WHERE av.Description LIKE '%LIVER%'
OR cs.CS_Description LIKE '%LIVER%'|||CAN SOMEONE PLS HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!|||See if this helps
CREATE TABLE #Test (Omim_No INT)
GO
INSERT INTO #Test SELECT Omim_No
FROM
(
SELECT Omim_No
FROM av
WHERE Description LIKE '%LIVER%'
UNION ALL
SELECT Omim_No
FROM cs
WHERE CS_Description LIKE '%LIVER%'
OR CS_DATA LIKE '%LIVER%'
UNION ALL
SELECT Omim_No
FROM ti
WHERE Omim_Titles LIKE '%LIVER%'
UNION ALL
SELECT Omim_No
FROM ti_alt_title
WHERE Omim_Alt_Titles LIKE '%LIVER%'
UNION ALL
SELECT Omim_No
FROM tx
WHERE Omim_Text LIKE '%LIVER%'
UNION ALL
SELECT subsnp_id,pop_id,allele_id
FROM AlleleFreqBySsPop
WHERE source LIKE '%LIVER%'
) AS Der
--JOIN
SELECT * FROM #Test JOIN Table
ON #Test.Omim_No=Table.Omim_No
"SQL noob" <SQLnoob@.discussions.microsoft.com> wrote in message
news:E2208714-9525-4379-9DAC-0BFCB236921A@.microsoft.com...
> CAN SOMEONE PLS HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!|||can you give a specific example?
"SQL noob" wrote:

> 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?
>|||SQL noob
I'm about your request. Can you give an example? What are you
trying to achive?
http://vyaskn.tripod.com/search_all..._all_tables.htm
"SQL noob" <SQLnoob@.discussions.microsoft.com> wrote in message
news:E90610EC-47CC-416D-B4B1-11C18B47E621@.microsoft.com...
> 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?
>|||something like that?
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%'
i want to search for the keywords, and display the result as in Omim_No and
link the Omim_No to a table contain Omim number.. i got multiple tables..
some tables contain only number without words..|||oh... come on.. pls help mi......|||Hi
Hmm, I posted the answer and it does not show up
I'd create a temporary table and using your queries with UNION ALL insert
the data into the table. Now that I inserted the data i'd JOIN this table
with your original one ON #Temp.Omim_No=Orig.Omim_No
"SQL noob" <SQLnoob@.discussions.microsoft.com> wrote in message
news:093C517E-2C62-4570-A7DF-BE5495EA7655@.microsoft.com...
> oh... come on.. pls help mi......

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 ?

Sunday, February 19, 2012

How to restrict editing of SQL Server 2005 data via ODBC link?

I have a sql server 2005 database with Delphi 2006 in the front end and for querrying and reporting we use MS Access 2003 by connecting to this database via ODBC connection. I recently found out that the SQL Server 2005 data connected thus can be edited (updated) from MS Access. I do not want end users to modify/update the SQL Server 2005 data from MS Access while I also want them to have the ability to insert/update/delete rights using the appropriate application interface. For now, I am handling this by creating a user id that is not permitted to update, insert and delete and using the same account in the ODBC. Is there a way in SQL Server 2005 you can control insert/update/delete rights for all users that will be applicable only in the ODBC mode?

Any help will be greatly appreciated.

thulo

Hi Thulo,

If I understand your question correctly, you want to be able to grant permissions to database objects based on the type of the client (ODBC, OLEDB, SqlClient, etc.), is this correct? Unfortunately, this isn't possible by design - the main goal is to provide the same functionality no matter what client is used. Instead, the SQL Server security model recommends what you are actually already doing - grant permissions "per database user". The user is the main permissions-related abstract here (having in mind the schemas, too). The user is related to the corresponding login object, which controls the connectivity part (having in mind endpoints permissions, too).

I understand that the user-based permissions concept might seem like more work, but it would pay off long term when the requirements to your application change.

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi Jivko,

You got my question right and that answers my question. Thanks so much for your help.

thulo