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

Wednesday, March 7, 2012

Creating primary key on a view

i'm connecting a view to microsoft mappoint using a .UDL. when i link the
data i need to select the primary key so i choose the customer number, but
there are a few shops that have to shops but one customer number so neither
go in to the map because they are duplicates. so i was wondering if i could
create a primary key in the view that is sort of like the autonumber in
access. so each shop would be given a number when the view is called and tha
t
could be my primary key. the number wouldn't even have to match up with the
same number every time i would just need it to get every shop into mappoint.
if anyone has any suggestions i would really appreciate it. thank you.
jb
Message posted via http://www.webservertalk.comjbennett via webservertalk.com wrote:
> i'm connecting a view to microsoft mappoint using a .UDL. when i link the
> data i need to select the primary key so i choose the customer number, but
> there are a few shops that have to shops but one customer number so neithe
r
> go in to the map because they are duplicates. so i was wondering if i coul
d
> create a primary key in the view that is sort of like the autonumber in
> access. so each shop would be given a number when the view is called and t
hat
> could be my primary key. the number wouldn't even have to match up with th
e
> same number every time i would just need it to get every shop into mappoin
t.
> if anyone has any suggestions i would really appreciate it. thank you.
> jb
> --
> Message posted via http://www.webservertalk.com
Adding an "auto-number" (the similar feature is called IDENTITY in SQL
Server) doesn't seem to make much sense for the situation you
described. For future reference, it's a reliable rule of thumb that
doing anything "like Access" in SQL Server is often going to be a big
mistake ;-)
Instead, create a table called Shops. Shops obviously isn't the same as
Customers.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||>
>Instead, create a table called Shops. Shops obviously isn't the same as
>Customers.
Thank you for your reply, i'll keep in mind not to try stuff in SQL that i
can do in access:) we already have a customer table. the problem is that we
ship ups and some of our shops have po boxes for address so we need a ship t
o
address which is stored in another table. so i created a view that pulls in
the customer info with the shipping address. after i did that i came across
a
problem that some shops had 2 stores under one customer number creating a
duplicate primary key, because in mappoint i had to use custno as the primar
y
key. we have shops added wly and inactivated wly so i would have to
update a table all the time, that is why i used a view. if there is a way to
create a table that automatically updates that would be great. thanks again
for all your help.
jb
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200606/1

Creating ODBC link within SELECT statement

Is this possible. To explain myself, here is my situation. I created an
Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
anyone to use this file on their PC, that same ODBC link must be setup. Is
their some code I can use within a Select Statement that will allow me to
bypass having to create an ODBC on everyone's PC?
Thanks.
Hi Preacher Man,
You've cross-posted this to a bunch of newsgroups, some of which, for
example microsoft.public.fox.vfp.queries-sql, don't even apply to your
question. What you haven't done is post to a relevant Excel newsgroup. Try
posting this question (and your other one) there.
Someone will probably tell you that you can use a connection string or a
DSN-less connection as described here:
http://support.microsoft.com/kb/q165866/ . (GoogleGroups helped me find
that.)
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@.msn.com www.cindywinegarden.com
"Preacher Man" <nospam> wrote in message
news:uFEmV7eJGHA.3936@.TK2MSFTNGP10.phx.gbl...
> Is this possible. To explain myself, here is my situation. I created an
> Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
> anyone to use this file on their PC, that same ODBC link must be setup.
> Is their some code I can use within a Select Statement that will allow me
> to bypass having to create an ODBC on everyone's PC?
> Thanks.
>

Creating ODBC link within SELECT statement

Is this possible. To explain myself, here is my situation. I created an
Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
anyone to use this file on their PC, that same ODBC link must be setup. Is
their some code I can use within a Select Statement that will allow me to
bypass having to create an ODBC on everyone's PC?
Thanks.
Hi Preacher Man,
You've cross-posted this to a bunch of newsgroups, some of which, for
example microsoft.public.fox.vfp.queries-sql, don't even apply to your
question. What you haven't done is post to a relevant Excel newsgroup. Try
posting this question (and your other one) there.
Someone will probably tell you that you can use a connection string or a
DSN-less connection as described here:
http://support.microsoft.com/kb/q165866/ . (GoogleGroups helped me find
that.)
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@.msn.com www.cindywinegarden.com
"Preacher Man" <nospam> wrote in message
news:uFEmV7eJGHA.3936@.TK2MSFTNGP10.phx.gbl...
> Is this possible. To explain myself, here is my situation. I created an
> Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
> anyone to use this file on their PC, that same ODBC link must be setup.
> Is their some code I can use within a Select Statement that will allow me
> to bypass having to create an ODBC on everyone's PC?
> Thanks.
>

Creating ODBC link within SELECT statement

Is this possible. To explain myself, here is my situation. I created an
Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
anyone to use this file on their PC, that same ODBC link must be setup. Is
their some code I can use within a Select Statement that will allow me to
bypass having to create an ODBC on everyone's PC?
Thanks.
Hi Preacher Man,
You've cross-posted this to a bunch of newsgroups, some of which, for
example microsoft.public.fox.vfp.queries-sql, don't even apply to your
question. What you haven't done is post to a relevant Excel newsgroup. Try
posting this question (and your other one) there.
Someone will probably tell you that you can use a connection string or a
DSN-less connection as described here:
http://support.microsoft.com/kb/q165866/ . (GoogleGroups helped me find
that.)
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@.msn.com www.cindywinegarden.com
"Preacher Man" <nospam> wrote in message
news:uFEmV7eJGHA.3936@.TK2MSFTNGP10.phx.gbl...
> Is this possible. To explain myself, here is my situation. I created an
> Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
> anyone to use this file on their PC, that same ODBC link must be setup.
> Is their some code I can use within a Select Statement that will allow me
> to bypass having to create an ODBC on everyone's PC?
> Thanks.
>

Creating ODBC link within SELECT statement

Is this possible. To explain myself, here is my situation. I created an
Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
anyone to use this file on their PC, that same ODBC link must be setup. Is
their some code I can use within a Select Statement that will allow me to
bypass having to create an ODBC on everyone's PC?
Thanks.Hi Preacher Man,
You've cross-posted this to a bunch of newsgroups, some of which, for
example microsoft.public.fox.vfp.queries-sql, don't even apply to your
question. What you haven't done is post to a relevant Excel newsgroup. Try
posting this question (and your other one) there.
Someone will probably tell you that you can use a connection string or a
DSN-less connection as described here:
http://support.microsoft.com/kb/q165866/ . (GoogleGroups helped me find
that.)
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@.msn.com www.cindywinegarden.com
"Preacher Man" <nospam> wrote in message
news:uFEmV7eJGHA.3936@.TK2MSFTNGP10.phx.gbl...
> Is this possible. To explain myself, here is my situation. I created an
> Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
> anyone to use this file on their PC, that same ODBC link must be setup.
> Is their some code I can use within a Select Statement that will allow me
> to bypass having to create an ODBC on everyone's PC?
> Thanks.
>

Creating ODBC link within SELECT statement

Is this possible. To explain myself, here is my situation. I created an
Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
anyone to use this file on their PC, that same ODBC link must be setup. Is
their some code I can use within a Select Statement that will allow me to
bypass having to create an ODBC on everyone's PC?
Thanks.Hi Preacher Man,
You've cross-posted this to a bunch of newsgroups, some of which, for
example microsoft.public.fox.vfp.queries-sql, don't even apply to your
question. What you haven't done is post to a relevant Excel newsgroup. Try
posting this question (and your other one) there.
Someone will probably tell you that you can use a connection string or a
DSN-less connection as described here:
http://support.microsoft.com/kb/q165866/ . (GoogleGroups helped me find
that.)
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@.msn.com www.cindywinegarden.com
"Preacher Man" <nospam> wrote in message
news:uFEmV7eJGHA.3936@.TK2MSFTNGP10.phx.gbl...
> Is this possible. To explain myself, here is my situation. I created an
> Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
> anyone to use this file on their PC, that same ODBC link must be setup.
> Is their some code I can use within a Select Statement that will allow me
> to bypass having to create an ODBC on everyone's PC?
> Thanks.
>

Creating ODBC link within SELECT statement

Is this possible. To explain myself, here is my situation. I created an
Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
anyone to use this file on their PC, that same ODBC link must be setup. Is
their some code I can use within a Select Statement that will allow me to
bypass having to create an ODBC on everyone's PC?
Thanks.Hi Preacher Man,
You've cross-posted this to a bunch of newsgroups, some of which, for
example microsoft.public.fox.vfp.queries-sql, don't even apply to your
question. What you haven't done is post to a relevant Excel newsgroup. Try
posting this question (and your other one) there.
Someone will probably tell you that you can use a connection string or a
DSN-less connection as described here:
http://support.microsoft.com/kb/q165866/ . (GoogleGroups helped me find
that.)
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@.msn.com www.cindywinegarden.com
"Preacher Man" <nospam> wrote in message
news:uFEmV7eJGHA.3936@.TK2MSFTNGP10.phx.gbl...
> Is this possible. To explain myself, here is my situation. I created an
> Excel Spreadsheet that uses an ODBC link to a SQL database. In order for
> anyone to use this file on their PC, that same ODBC link must be setup.
> Is their some code I can use within a Select Statement that will allow me
> to bypass having to create an ODBC on everyone's PC?
> Thanks.
>

Friday, February 24, 2012

Creating logfunctionality

Hello!

Does anyone have a link to some good information about creating log functionality for SQL-server. Basically I want to track changes made to a table, through an update-trigger. I would like to store both the old values and the new values (is this possible?), in a new table.

Thanks!

/MagnusI don't have a link for you but this is easy to do...

First readup on triggers in the Books on line. Checkout the following keywords:

"triggers, programming"
"triggers, multirow"
"triggers, inserted tables"
"triggers, last trigger"

In the trigger, you will want to select rows from the temporary memory-resident "inserted" or "deleted" tables. the "inserted" table holds the new stuff and the "deleted" table holds the old stuff.

For an insert you would select just from the "inserted" table and insert this into the new part of the audit table.

For an Update write a select to join the "deleted" table to the "inserted" table for the before and after stuff. Again, the "deleted" table is the old and the "inserted" table is the new. You will need to have well defined keys for this to work right.

For a delete, you guessed it, select data from the "deleted" table and insert the results into the old part of the audit table.

Remember that in SQL Server the triggers fire AFTER the Insert/Update/Delete. If you are using multipule triggers I would make this the last trigger to fire so you don't have to roll back your audit if something fails your business logic.

Post back if you have more questions.

Creating link via Internet

Hello there
I have local sql server database on my server
I have also another sql database on my internet
I would like to transfare data from my local server to the internet server
at 12:00 pm every day
How can i create kink to the database on the server?
A few ways:
1. SQL Replication.
2. SQL DTS job
3. SQL Agent Scheduled Job
See SQL Books on Line. All three of these options are covered in depth.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Tuesday, February 14, 2012

Creating Database

I have a question that I am hoping someone can answer. Is it possible to
link external sources to a database? What I am wondering is, that if I am
creating a music database for CDs, can I program it so that the database
will collect data from something like Windows Media Player or an external
website? Now I would be doing this with SQL 2005. Any help or thoughts
about this would be appreciated.
Michael R. Mastro IIAre you talking about , consuming feeds or saving web pages?
If so , it's definately possible to consume feeds . Where it gets a bit more
interesting , i sif you are doing loads of string manipulations on the fly
to isolate the information you need. You may be better off , doing all the
getURL in Java or .Net , and then storing all relevant information in the db
--
Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com
"Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
news:%23MYHZiCaHHA.5044@.TK2MSFTNGP05.phx.gbl...
>I have a question that I am hoping someone can answer. Is it possible to
>link external sources to a database? What I am wondering is, that if I am
>creating a music database for CDs, can I program it so that the database
>will collect data from something like Windows Media Player or an external
>website? Now I would be doing this with SQL 2005. Any help or thoughts
>about this would be appreciated.
> Michael R. Mastro II
>|||I would say probably consuming feeds. What I am actually trying to do is,
say I stick a CD in the computer. It brings up Media Player or whatever
program, maybe Musicmatch, but the point is, the program brings up all
relevant information about that said CD. What I want to do is take that
information from the program and store it in SQL 2005.
Michael R. Mastro II
"Jack Vamvas" <DEL_TO_REPLY@.del.com> wrote in message
news:NL-dnUT3PrImMmbYnZ2dnUVZ8qminZ2d@.bt.com...
> Are you talking about , consuming feeds or saving web pages?
> If so , it's definately possible to consume feeds . Where it gets a bit
> more interesting , i sif you are doing loads of string manipulations on
> the fly to isolate the information you need. You may be better off , doing
> all the getURL in Java or .Net , and then storing all relevant information
> in the db
> --
> Jack Vamvas
> ___________________________________
> Advertise your IT vacancies for free at - http://www.ITjobfeed.com
>
> "Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
> news:%23MYHZiCaHHA.5044@.TK2MSFTNGP05.phx.gbl...
>>I have a question that I am hoping someone can answer. Is it possible to
>>link external sources to a database? What I am wondering is, that if I am
>>creating a music database for CDs, can I program it so that the database
>>will collect data from something like Windows Media Player or an external
>>website? Now I would be doing this with SQL 2005. Any help or thoughts
>>about this would be appreciated.
>> Michael R. Mastro II
>|||"Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
news:%23MYHZiCaHHA.5044@.TK2MSFTNGP05.phx.gbl...
>I have a question that I am hoping someone can answer. Is it possible to
>link external sources to a database? What I am wondering is, that if I am
>creating a music database for CDs, can I program it so that the database
>will collect data from something like Windows Media Player or an external
>website? Now I would be doing this with SQL 2005. Any help or thoughts
>about this would be appreciated.
>
Well a database is just that, a database. It really doesn't "collect data".
For that you need a separate app between the database itself and the one you
want to collect data from.
Having said that, what you want to do shouldn't be all that hard with some
programming.
> Michael R. Mastro II
>
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com|||So what parameters would you need to set within the database to program it
in such a way?
Michael R. Mastro II
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:uFgBlMNaHHA.596@.TK2MSFTNGP06.phx.gbl...
> "Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
> news:%23MYHZiCaHHA.5044@.TK2MSFTNGP05.phx.gbl...
>>I have a question that I am hoping someone can answer. Is it possible to
>>link external sources to a database? What I am wondering is, that if I am
>>creating a music database for CDs, can I program it so that the database
>>will collect data from something like Windows Media Player or an external
>>website? Now I would be doing this with SQL 2005. Any help or thoughts
>>about this would be appreciated.
> Well a database is just that, a database. It really doesn't "collect
> data". For that you need a separate app between the database itself and
> the one you want to collect data from.
> Having said that, what you want to do shouldn't be all that hard with some
> programming.
>
>> Michael R. Mastro II
>
> --
> Greg Moore
> SQL Server DBA Consulting
> Email: sql (at) greenms.com http://www.greenms.com
>|||Hi,
One way is to write a program that runs as a services and monitor for
windows media player. What I do not know is, weather it is possible to read
the data that is loaded into windows media player. If that is possible then
your program can take that data and update the SQL server.
Regards,
Kueh
"Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
news:%23pm$8DWaHHA.4888@.TK2MSFTNGP06.phx.gbl...
> So what parameters would you need to set within the database to program it
> in such a way?
> Michael R. Mastro II
> "Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in
> message news:uFgBlMNaHHA.596@.TK2MSFTNGP06.phx.gbl...
>> "Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
>> news:%23MYHZiCaHHA.5044@.TK2MSFTNGP05.phx.gbl...
>>I have a question that I am hoping someone can answer. Is it possible to
>>link external sources to a database? What I am wondering is, that if I
>>am creating a music database for CDs, can I program it so that the
>>database will collect data from something like Windows Media Player or an
>>external website? Now I would be doing this with SQL 2005. Any help or
>>thoughts about this would be appreciated.
>>
>> Well a database is just that, a database. It really doesn't "collect
>> data". For that you need a separate app between the database itself and
>> the one you want to collect data from.
>> Having said that, what you want to do shouldn't be all that hard with
>> some programming.
>>
>> Michael R. Mastro II
>>
>>
>> --
>> Greg Moore
>> SQL Server DBA Consulting
>> Email: sql (at) greenms.com http://www.greenms.com
>>
>|||"Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
news:%23pm$8DWaHHA.4888@.TK2MSFTNGP06.phx.gbl...
> So what parameters would you need to set within the database to program it
> in such a way?
>
I don't think anyone else replied either.
It's not a matter of setting parameters within the database.
Select your language and write the program in that. Could be perl, VB, C#,
etc.
The database is simply a repository for the data in this case.
> Michael R. Mastro II
> "Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in
> message news:uFgBlMNaHHA.596@.TK2MSFTNGP06.phx.gbl...
>> "Michael Mastro" <MikeRM2XXX@.worldnet.att.net> wrote in message
>> news:%23MYHZiCaHHA.5044@.TK2MSFTNGP05.phx.gbl...
>>I have a question that I am hoping someone can answer. Is it possible to
>>link external sources to a database? What I am wondering is, that if I
>>am creating a music database for CDs, can I program it so that the
>>database will collect data from something like Windows Media Player or an
>>external website? Now I would be doing this with SQL 2005. Any help or
>>thoughts about this would be appreciated.
>>
>> Well a database is just that, a database. It really doesn't "collect
>> data". For that you need a separate app between the database itself and
>> the one you want to collect data from.
>> Having said that, what you want to do shouldn't be all that hard with
>> some programming.
>>
>> Michael R. Mastro II
>>
>>
>> --
>> Greg Moore
>> SQL Server DBA Consulting
>> Email: sql (at) greenms.com http://www.greenms.com
>>
>
--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html