Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Friday, March 30, 2012

newbie question on SQL Server, ODBC

In general the ole db provider for sql server is
fastest. But in some situations I think the ole db
provider for odbc is faster. Best bet is to try both and
test!
Sincerely,
Invotion Engineering Team
Advanced Microsoft Hosting Solutions
http://www.Invotion.com

>--Original Message--
>Hi,
>I'm trying to access a MS SQL Server db
>from a CGI (pure C program).
>Which is the most efficient (fast, incl. fetching
>many records on a search term) ...using
>embedded SQL in C, ODBC or any other methods?
>Any suggestions?
>Jon
>.
>Thanks.
"Invotion" <anonymous@.discussions.microsoft.com> wrote in message news:<1520b01c3fa36$d4a1f
e30$a401280a@.phx.gbl>...
> In general the ole db provider for sql server is
> fastest. But in some situations I think the ole db
> provider for odbc is faster. Best bet is to try both and
> test!
> Sincerely,
> Invotion Engineering Team
> Advanced Microsoft Hosting Solutions
> http://www.Invotion.com
>

Newbie Question on =Today()

I need to pull some reports from an older ERP system in the US via ODBC
I have the report in play, but want to limit the criteria to the items
shipped today
I have a TODAY_FIELD as a calculated Field with the parameter =TODAY()
The Format of the Oracle view is mm/dd/yyyy hh:mm:ss AM and the
TODAY_FIELD
matches that. (ie 8/30/2006 12:00:00 AM)
So I am looking for the criteria for WHERE (REAL_SHIP_DATE >
TODAY()) which will not generate and ORA-00904 error.
Can anyone please help?getdate() is the system date to use. Or am I understanding what you want
wrong?
"VB" <vodkablokey@.gmail.com> wrote in message
news:1156941597.512536.214380@.b28g2000cwb.googlegroups.com...
>I need to pull some reports from an older ERP system in the US via ODBC
> I have the report in play, but want to limit the criteria to the items
> shipped today
> I have a TODAY_FIELD as a calculated Field with the parameter =TODAY()
> The Format of the Oracle view is mm/dd/yyyy hh:mm:ss AM and the
> TODAY_FIELD
> matches that. (ie 8/30/2006 12:00:00 AM)
> So I am looking for the criteria for WHERE (REAL_SHIP_DATE >
> TODAY()) which will not generate and ORA-00904 error.
> Can anyone please help?
>|||Ben Watts wrote:
> getdate() is the system date to use. Or am I understanding what you want
> wrong?
> "VB" <vodkablokey@.gmail.com> wrote in message
> news:1156941597.512536.214380@.b28g2000cwb.googlegroups.com...
> >I need to pull some reports from an older ERP system in the US via ODBC
> >
> > I have the report in play, but want to limit the criteria to the items
> > shipped today
> >
> > I have a TODAY_FIELD as a calculated Field with the parameter =TODAY()
> >
> > The Format of the Oracle view is mm/dd/yyyy hh:mm:ss AM and the
> > TODAY_FIELD
> > matches that. (ie 8/30/2006 12:00:00 AM)
> >
> > So I am looking for the criteria for WHERE (REAL_SHIP_DATE >
> > TODAY()) which will not generate and ORA-00904 error.
> >
> > Can anyone please help?
> >
I am looking to report all shipping transactions (TRANSACTION_CODE ='OESHIP') which have happened since Midnight.
I know = TODAY() will give you 12:00am today, how do I pass this as a
criteria to a ODBC database call?
I had tried =TODAY() but this is rejected, it seems to suggest I need
to use TO_DATE, but I don't know how to do this either.
Thanks for getting back though :)|||Try:
WHERE REAL_SHIP_DATE > CAST( CONVERT( VARCHAR(8), GETDATE(), 112) AS DATETIME)
This takes the the curent system time, as suggested by Ben, chops of the
time and returns a DateTime value at the very start of the day, similar to
the vb Today() function.
HTH,
Magendo_man
"VB" wrote:
> Ben Watts wrote:
> > getdate() is the system date to use. Or am I understanding what you want
> > wrong?
> > "VB" <vodkablokey@.gmail.com> wrote in message
> > news:1156941597.512536.214380@.b28g2000cwb.googlegroups.com...
> > >I need to pull some reports from an older ERP system in the US via ODBC
> > >
> > > I have the report in play, but want to limit the criteria to the items
> > > shipped today
> > >
> > > I have a TODAY_FIELD as a calculated Field with the parameter =TODAY()
> > >
> > > The Format of the Oracle view is mm/dd/yyyy hh:mm:ss AM and the
> > > TODAY_FIELD
> > > matches that. (ie 8/30/2006 12:00:00 AM)
> > >
> > > So I am looking for the criteria for WHERE (REAL_SHIP_DATE >
> > > TODAY()) which will not generate and ORA-00904 error.
> > >
> > > Can anyone please help?
> > >
> I am looking to report all shipping transactions (TRANSACTION_CODE => 'OESHIP') which have happened since Midnight.
> I know = TODAY() will give you 12:00am today, how do I pass this as a
> criteria to a ODBC database call?
> I had tried =TODAY() but this is rejected, it seems to suggest I need
> to use TO_DATE, but I don't know how to do this either.
> Thanks for getting back though :)
>|||magendo_man wrote:
> Try:
> WHERE REAL_SHIP_DATE > CAST( CONVERT( VARCHAR(8), GETDATE(), 112) AS DATETIME)
> This takes the the curent system time, as suggested by Ben, chops of the
> time and returns a DateTime value at the very start of the day, similar to
> the vb Today() function.
> HTH,
> Magendo_man
> "VB" wrote:
> >
> > Ben Watts wrote:
> > > getdate() is the system date to use. Or am I understanding what you want
> > > wrong?
> > > "VB" <vodkablokey@.gmail.com> wrote in message
> > > news:1156941597.512536.214380@.b28g2000cwb.googlegroups.com...
> > > >I need to pull some reports from an older ERP system in the US via ODBC
> > > >
> > > > I have the report in play, but want to limit the criteria to the items
> > > > shipped today
> > > >
> > > > I have a TODAY_FIELD as a calculated Field with the parameter =TODAY()
> > > >
> > > > The Format of the Oracle view is mm/dd/yyyy hh:mm:ss AM and the
> > > > TODAY_FIELD
> > > > matches that. (ie 8/30/2006 12:00:00 AM)
> > > >
> > > > So I am looking for the criteria for WHERE (REAL_SHIP_DATE >
> > > > TODAY()) which will not generate and ORA-00904 error.
> > > >
> > > > Can anyone please help?
> > > >
> >
> > I am looking to report all shipping transactions (TRANSACTION_CODE => > 'OESHIP') which have happened since Midnight.
> >
> > I know = TODAY() will give you 12:00am today, how do I pass this as a
> > criteria to a ODBC database call?
> >
> > I had tried =TODAY() but this is rejected, it seems to suggest I need
> > to use TO_DATE, but I don't know how to do this either.
> >
> > Thanks for getting back though :)
> >
> >
THanks, that would do the trick.
When I try it though I get a new error, INVALID or MISSING EXPRESSION
Any ideas?|||VB wrote:
> magendo_man wrote:
> > Try:
> >
> > WHERE REAL_SHIP_DATE > CAST( CONVERT( VARCHAR(8), GETDATE(), 112) AS DATETIME)
> >
> > This takes the the curent system time, as suggested by Ben, chops of the
> > time and returns a DateTime value at the very start of the day, similar to
> > the vb Today() function.
> >
> > HTH,
> > Magendo_man
> >
> > "VB" wrote:
> >
> > >
> > > Ben Watts wrote:
> > > > getdate() is the system date to use. Or am I understanding what you want
> > > > wrong?
> > > > "VB" <vodkablokey@.gmail.com> wrote in message
> > > > news:1156941597.512536.214380@.b28g2000cwb.googlegroups.com...
> > > > >I need to pull some reports from an older ERP system in the US via ODBC
> > > > >
> > > > > I have the report in play, but want to limit the criteria to the items
> > > > > shipped today
> > > > >
> > > > > I have a TODAY_FIELD as a calculated Field with the parameter =TODAY()
> > > > >
> > > > > The Format of the Oracle view is mm/dd/yyyy hh:mm:ss AM and the
> > > > > TODAY_FIELD
> > > > > matches that. (ie 8/30/2006 12:00:00 AM)
> > > > >
> > > > > So I am looking for the criteria for WHERE (REAL_SHIP_DATE >
> > > > > TODAY()) which will not generate and ORA-00904 error.
> > > > >
> > > > > Can anyone please help?
> > > > >
> > >
> > > I am looking to report all shipping transactions (TRANSACTION_CODE => > > 'OESHIP') which have happened since Midnight.
> > >
> > > I know = TODAY() will give you 12:00am today, how do I pass this as a
> > > criteria to a ODBC database call?
> > >
> > > I had tried =TODAY() but this is rejected, it seems to suggest I need
> > > to use TO_DATE, but I don't know how to do this either.
> > >
> > > Thanks for getting back though :)
> > >
> > >
> THanks, that would do the trick.
> When I try it though I get a new error, INVALID or MISSING EXPRESSION
> Any ideas?
SOrry Folks, I realised (eventually) instead of trying to re-invent the
wheel I should just create a view in the database with the sysdate -1
call and just report the view.

Friday, March 9, 2012

Newbie Alert: Amending all client workstation ODBC's

Hi All,
Newbie question for you all, sorry. I'm currently migrating my DB's to a
new SQL 2000 server and am wondering if there's any way of centrally
changing the ODBC settings of all my workstations? I really don't want to
have the support guys visit each machine in turn and do this manually.
Any advice gratefully received.
Orb.
The ODBC aliases are stored within the registry. Assuming that you are just
changing a server name or IP address of the currently configured database
server you should be able to create a .reg file that your users can "run"
within the logon script.
There is one issue with this method: The users have to have the ability to
write to that part of the registry.
Keith Kratochvil
"Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
news:eto7MV0TGHA.4952@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Newbie question for you all, sorry. I'm currently migrating my DB's to a
> new SQL 2000 server and am wondering if there's any way of centrally
> changing the ODBC settings of all my workstations? I really don't want to
> have the support guys visit each machine in turn and do this manually.
>
> Any advice gratefully received.
> Orb.
>
|||Hi Keith,
Thanks for replying. I thought this might be the case, I just wondered if I
was missing any fancy enterprise tools which would do this for me ;o)
Many Thanks,
Orb.
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:%23tn$eu0TGHA.5332@.tk2msftngp13.phx.gbl...
> The ODBC aliases are stored within the registry. Assuming that you are
> just changing a server name or IP address of the currently configured
> database server you should be able to create a .reg file that your users
> can "run" within the logon script.
> There is one issue with this method: The users have to have the ability
> to write to that part of the registry.
> --
> Keith Kratochvil
>
> "Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
> news:eto7MV0TGHA.4952@.TK2MSFTNGP09.phx.gbl...
>
|||We used .reg files in my last shop to update DSNs when needed. This method
worked great!
Keith Kratochvil
"Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
news:esSsqa1TGHA.4900@.TK2MSFTNGP12.phx.gbl...
> Hi Keith,
> Thanks for replying. I thought this might be the case, I just wondered if
> I was missing any fancy enterprise tools which would do this for me ;o)
>
> Many Thanks,
> Orb.
>
> "Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
> news:%23tn$eu0TGHA.5332@.tk2msftngp13.phx.gbl...
>

Newbie ahoy! - SQL Server database keeps freezing...

Hi,
I've something of a mystery.
Our DB currently runs as a SQL Server 2000 database linked to a number of
Access MDB front ends via an ODBC connection.
We're having problems with the response of the server. Basically, when a
user is entering / updating data, when they try to update a record, the ODBC
connection times out.
I've checked the server and there doesn't appear to be any problems with
SQL2000.
However, I am something of a complete newbie when it comes to SQL server. In
light of this can anyone recommend any steps I should take to investigate
and diagnose this.
In particular, I know SQL server keeps logs but I'm not sure to what detail
and how to access them.
Sorry to appear like a complete idiot but I guess we all have to start
somewhere. :)
Thanks
Chris StrugA common cause of these symptoms is blocking. You can run sp_who2 from
Query Analyzer to identify the blocked/blocking processes. Note that a
SELECT statement will hold locks until the resultset is processed so it
is important that the application to retrieve results as soon as
possible and keep transactions short.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"Chris Strug" <hotmail@.solace1884.com> wrote in message
news:%23Ti2WgETDHA.2852@.tk2msftngp13.phx.gbl...
> Hi,
> I've something of a mystery.
> Our DB currently runs as a SQL Server 2000 database linked to a number
of
> Access MDB front ends via an ODBC connection.
> We're having problems with the response of the server. Basically, when
a
> user is entering / updating data, when they try to update a record,
the ODBC
> connection times out.
> I've checked the server and there doesn't appear to be any problems
with
> SQL2000.
> However, I am something of a complete newbie when it comes to SQL
server. In
> light of this can anyone recommend any steps I should take to
investigate
> and diagnose this.
> In particular, I know SQL server keeps logs but I'm not sure to what
detail
> and how to access them.
> Sorry to appear like a complete idiot but I guess we all have to start
> somewhere. :)
> Thanks
> Chris Strug
>