Showing posts with label program. Show all posts
Showing posts with label program. Show all posts

Friday, March 30, 2012

out-of-range smalldatatime value

I am trying to insert a rown into a table with this line in my program :

INSERT INTO MYTABLE (Usuario, Datahora, COD_PROG, Tabela, TipoMov, Registro, Campo, ValAnt, ValAtu, Motivo, Sequencial) VALUES (23, '06/28/2007 19:53:45', '002101', 'Contribuinte', 'A', '1006626', ' ', 'Isentou Tx 2a Via 062007', ' ', ' ', ' ')

and I am receiving this message :

The conversion of char data type to smalldatatime data type resulted in an out-of-range smalldatatime value.

Thanks

Hello

I suppose that the smalldatetime has the value 06/28/2007 19:53:45

what is the language used for the server ?

the format of the date is corresponding to month/day/year ( american format ).Maybe it's the origin of the problem.

For the french format ( dd/mm/yyyy ), you have an error ( 28 does not correspond to a month )

Have a good day

|||

The smalldatetime datatype does NOT include seconds. But it truncates the seconds. -That isn't the problem.

I suspect that your server is expecting a date in the form of 'dd/mm/yyyy', and you are providing 'mm/dd/yyyy'.

If you changed the date format on the INSERT data to the ISO standard of 'yyyy/mm/dd', you wouldn't have any problem.

|||Thank you, that's ok now.

OutOfMemoryException with SQL Server Mobile

Hi,

I'm getting always an OutOfMemoryException after my program runs for a while. It's a smartphone application running on .NET 2.0 CF and using the SQL Server Mobile 2005. Sometimes it's even not a OutOfMemoryException but a SqlCeException. But it's always when the phone is having little free memory left.

I have also created a few custom controls (I even implemented the Disposable interface) to dispose all resources (Fonts, Bitmaps). I'm using all Pens and Brushes always in "using" blocks, to have them disposed immediately after having used them. The program does not have any static objects or lists of objects that are hold in memory for a long time.

I really don't understand why I get this exception. I see it always happen after doing a lot queries on the SQL Server Mobile. Is this tool using a lot memory? Can I flush somehow the memory of the SQL Server? Should I run also manually sometimes the GarbageCollector? Does this thing not run automatically?

Can anybody, perhaps of MSFT help me? I'm also willing to share the full source code with MSFT, if required.

You will probably get a faster answer on the Sql Server Mobile forum.

Moving this thread to that forum.

|||

Here are a few suggestions (from an earlier thread)

1) Try to use SqlCeResultSet than DataSet

2) Please dispose the managed objects explicitly instead of waiting for garbage collector to pick them up. Please also note that SqlCeCommand object can be reused and they need to be disposed explicitly

In addtion you can email me your project and I'll be glad to look into this issue for you.

Mark dot Ihimoyan at microsoft dot com

OUTLOOK message into SQL database

Hi Everybody,
I'm doing a program to generate newsletter and in turn need to read the boun
ced email message from OUTLOOK and store these data into SQL db. These bounc
ed email addresses will need to be collected and for further processing.
But different ISP has different format of presenting their bounced email for
mat, eg. some will included the bounced email address in the subject, some i
n the content and some as attachment. Has anyone done this before, extractin
g specified information from OUTLOOK message and update into SQL db?
Would appreciate if somebody can show me some light.
Thanks in advance.
KristeI didnt directly used Outlook, i used Exchange server to get my message fro
m the folder
and put it in the SQL Server DB. Would beinteresting if you also have the ch
ance to get to your inbox on a Exchange server or via IMAP or if you only ha
ve the change to get the information from a pop3 pop or just outlook.
If you were sending out the information from the Account SQL Server is using
for sending E-Mails the XP
xp_readmail would be a choice for you. It reads the inbox messages of the ac
coutn of SQL Server (Agent).
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Kriste L" <whiteegg@.hotmail.com> schrieb im Newsbeitrag news:uKLxqxUUFHA.28
92@.TK2MSFTNGP14.phx.gbl...
Hi Everybody,
I'm doing a program to generate newsletter and in turn need to read the boun
ced email message from OUTLOOK and store these data into SQL db. These bounc
ed email addresses will need to be collected and for further processing.
But different ISP has different format of presenting their bounced email for
mat, eg. some will included the bounced email address in the subject, some i
n the content and some as attachment. Has anyone done this before, extractin
g specified information from OUTLOOK message and update into SQL db?
Would appreciate if somebody can show me some light.
Thanks in advance.
Kriste

Wednesday, March 28, 2012

Outlook 2003 does not work with SQL Mail !

It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
unless you are using an Exchange Server. The SQL Mail program and Outlook
2003 *BOTH* try to open the Personal Folder file (.pst file) and one of them
fails.
If I close the Outlook 2003 client, SQL Mail works fine, except that the
mail does not go out! The mail only goes out when the Outlook client is
running and since the .pst file is locked, it only runs when SQL Mail is
disabled!
So I can't generate email alerts in SQL unless I close down Outlook and I
can't get those alerts to go out unless I disable SQL Mail. What a crappy
setup! ... or am I missing something?
No you are not. That is the way it is. If you want trouble free SQL Mail
with Outlook you must use Outlook 2000. Otherwise you will run into Access
denied erros in the MAPI subsystem. That is because SQL Mail does not
release MAPI. You have to shut down the SQL Server Service. Fire up
Outlook then restart the SQL Service but as soon as SQL Mail acts once you
will be right back to the MAPI access deniied errors.
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> unless you are using an Exchange Server. The SQL Mail program and Outlook
> 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
them
> fails.
> If I close the Outlook 2003 client, SQL Mail works fine, except that the
> mail does not go out! The mail only goes out when the Outlook client is
> running and since the .pst file is locked, it only runs when SQL Mail is
> disabled!
> So I can't generate email alerts in SQL unless I close down Outlook and I
> can't get those alerts to go out unless I disable SQL Mail. What a crappy
> setup! ... or am I missing something?
>
|||Actually there is a workaround for this issue. Let me know if you want to
hear how it is done and I can explain it to you.
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> unless you are using an Exchange Server. The SQL Mail program and Outlook
> 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
them
> fails.
> If I close the Outlook 2003 client, SQL Mail works fine, except that the
> mail does not go out! The mail only goes out when the Outlook client is
> running and since the .pst file is locked, it only runs when SQL Mail is
> disabled!
> So I can't generate email alerts in SQL unless I close down Outlook and I
> can't get those alerts to go out unless I disable SQL Mail. What a crappy
> setup! ... or am I missing something?
>
|||Yes, let me know what the workaround is!
Fred
"George Hester" wrote:

> Actually there is a workaround for this issue. Let me know if you want to
> hear how it is done and I can explain it to you.
> --
> George Hester
> _________________________________
> "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> them
>
|||OK. What you do is set 2 Profiles in Microsoft Outlook. You will get your
eMail in one profile and the other will receive your SQL Alerts. The SQL
Mail holds on to the MAPI service. This is the reason for the error. So if
you start Outlook with your SQL Mail profile before SQL Mail starts then
start SQL Mail you will get your alerts. You can then close Outlook and go
back into your eMail Profile. But you cannot reopen Outlook with the SQL
Mail profile while SQL Mail is using that profile, running. You have to
stop SQL Mail then go into the SQL Mail Profile with Outlook then restart
SQL Mail.
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:30265F89-8F2B-4296-8CDA-C577B9AEE5E7@.microsoft.com...[vbcol=seagreen]
> Yes, let me know what the workaround is!
>
> Fred
> "George Hester" wrote:
to[vbcol=seagreen]
Mail,[vbcol=seagreen]
Outlook[vbcol=seagreen]
of[vbcol=seagreen]
the[vbcol=seagreen]
is[vbcol=seagreen]
is[vbcol=seagreen]
and I[vbcol=seagreen]
crappy[vbcol=seagreen]
|||Sorry George, you lost me there. The problem I have with Outlook 2003 and SQL
alerts is that the SQL alerts are generated, but don't go out unless Outlook
is running.
I am not sure how having two mail profiles will help. I have tried setting
up an Outlook email profile (say OutlookMail) and a SQL email profile (say
SQLMail). If I then set up SQL Alerts to use the SQLMail profile and launch
Outlook using the OutlooMail profile, everything works, *except* that the
alerts are generated, but don't go out!
Just having Outlook running (with the OutlookMail profile) does not seem to
help the SQL alerts. They are not going out, because the SQLMail profile's
mailbox (.pst file) is not being processed, only the OutlookMail mailbox is.
Did I miss something? I even tried setting up the OutlookMail profile in
Outlook to read and process the SQLMail profile's mail file, but that did not
work either.
Help !!
"George Hester" wrote:

> OK. What you do is set 2 Profiles in Microsoft Outlook. You will get your
> eMail in one profile and the other will receive your SQL Alerts. The SQL
> Mail holds on to the MAPI service. This is the reason for the error. So if
> you start Outlook with your SQL Mail profile before SQL Mail starts then
> start SQL Mail you will get your alerts. You can then close Outlook and go
> back into your eMail Profile. But you cannot reopen Outlook with the SQL
> Mail profile while SQL Mail is using that profile, running. You have to
> stop SQL Mail then go into the SQL Mail Profile with Outlook then restart
> SQL Mail.
> --
> George Hester
> _________________________________
> "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> news:30265F89-8F2B-4296-8CDA-C577B9AEE5E7@.microsoft.com...
> to
> Mail,
> Outlook
> of
> the
> is
> is
> and I
> crappy
>

Outlook 2003 does not work with SQL Mail !

It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
unless you are using an Exchange Server. The SQL Mail program and Outlook
2003 *BOTH* try to open the Personal Folder file (.pst file) and one of them
fails.
If I close the Outlook 2003 client, SQL Mail works fine, except that the
mail does not go out! The mail only goes out when the Outlook client is
running and since the .pst file is locked, it only runs when SQL Mail is
disabled!
So I can't generate email alerts in SQL unless I close down Outlook and I
can't get those alerts to go out unless I disable SQL Mail. What a crappy
setup! ... or am I missing something?No you are not. That is the way it is. If you want trouble free SQL Mail
with Outlook you must use Outlook 2000. Otherwise you will run into Access
denied erros in the MAPI subsystem. That is because SQL Mail does not
release MAPI. You have to shut down the SQL Server Service. Fire up
Outlook then restart the SQL Service but as soon as SQL Mail acts once you
will be right back to the MAPI access deniied errors.
--
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> unless you are using an Exchange Server. The SQL Mail program and Outlook
> 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
them
> fails.
> If I close the Outlook 2003 client, SQL Mail works fine, except that the
> mail does not go out! The mail only goes out when the Outlook client is
> running and since the .pst file is locked, it only runs when SQL Mail is
> disabled!
> So I can't generate email alerts in SQL unless I close down Outlook and I
> can't get those alerts to go out unless I disable SQL Mail. What a crappy
> setup! ... or am I missing something?
>|||Actually there is a workaround for this issue. Let me know if you want to
hear how it is done and I can explain it to you.
--
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> unless you are using an Exchange Server. The SQL Mail program and Outlook
> 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
them
> fails.
> If I close the Outlook 2003 client, SQL Mail works fine, except that the
> mail does not go out! The mail only goes out when the Outlook client is
> running and since the .pst file is locked, it only runs when SQL Mail is
> disabled!
> So I can't generate email alerts in SQL unless I close down Outlook and I
> can't get those alerts to go out unless I disable SQL Mail. What a crappy
> setup! ... or am I missing something?
>|||Yes, let me know what the workaround is!
Fred
"George Hester" wrote:
> Actually there is a workaround for this issue. Let me know if you want to
> hear how it is done and I can explain it to you.
> --
> George Hester
> _________________________________
> "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> > It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> > unless you are using an Exchange Server. The SQL Mail program and Outlook
> > 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
> them
> > fails.
> >
> > If I close the Outlook 2003 client, SQL Mail works fine, except that the
> > mail does not go out! The mail only goes out when the Outlook client is
> > running and since the .pst file is locked, it only runs when SQL Mail is
> > disabled!
> >
> > So I can't generate email alerts in SQL unless I close down Outlook and I
> > can't get those alerts to go out unless I disable SQL Mail. What a crappy
> > setup! ... or am I missing something?
> >
> >
>|||OK. What you do is set 2 Profiles in Microsoft Outlook. You will get your
eMail in one profile and the other will receive your SQL Alerts. The SQL
Mail holds on to the MAPI service. This is the reason for the error. So if
you start Outlook with your SQL Mail profile before SQL Mail starts then
start SQL Mail you will get your alerts. You can then close Outlook and go
back into your eMail Profile. But you cannot reopen Outlook with the SQL
Mail profile while SQL Mail is using that profile, running. You have to
stop SQL Mail then go into the SQL Mail Profile with Outlook then restart
SQL Mail.
--
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:30265F89-8F2B-4296-8CDA-C577B9AEE5E7@.microsoft.com...
> Yes, let me know what the workaround is!
>
> Fred
> "George Hester" wrote:
> > Actually there is a workaround for this issue. Let me know if you want
to
> > hear how it is done and I can explain it to you.
> >
> > --
> >
> > George Hester
> > _________________________________
> > "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> > news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> > > It would appear that Outlook 2003 (and 2002) does not work with SQL
Mail,
> > > unless you are using an Exchange Server. The SQL Mail program and
Outlook
> > > 2003 *BOTH* try to open the Personal Folder file (.pst file) and one
of
> > them
> > > fails.
> > >
> > > If I close the Outlook 2003 client, SQL Mail works fine, except that
the
> > > mail does not go out! The mail only goes out when the Outlook client
is
> > > running and since the .pst file is locked, it only runs when SQL Mail
is
> > > disabled!
> > >
> > > So I can't generate email alerts in SQL unless I close down Outlook
and I
> > > can't get those alerts to go out unless I disable SQL Mail. What a
crappy
> > > setup! ... or am I missing something?
> > >
> > >
> >
> >|||Sorry George, you lost me there. The problem I have with Outlook 2003 and SQL
alerts is that the SQL alerts are generated, but don't go out unless Outlook
is running.
I am not sure how having two mail profiles will help. I have tried setting
up an Outlook email profile (say OutlookMail) and a SQL email profile (say
SQLMail). If I then set up SQL Alerts to use the SQLMail profile and launch
Outlook using the OutlooMail profile, everything works, *except* that the
alerts are generated, but don't go out!
Just having Outlook running (with the OutlookMail profile) does not seem to
help the SQL alerts. They are not going out, because the SQLMail profile's
mailbox (.pst file) is not being processed, only the OutlookMail mailbox is.
Did I miss something? I even tried setting up the OutlookMail profile in
Outlook to read and process the SQLMail profile's mail file, but that did not
work either.
Help !!
"George Hester" wrote:
> OK. What you do is set 2 Profiles in Microsoft Outlook. You will get your
> eMail in one profile and the other will receive your SQL Alerts. The SQL
> Mail holds on to the MAPI service. This is the reason for the error. So if
> you start Outlook with your SQL Mail profile before SQL Mail starts then
> start SQL Mail you will get your alerts. You can then close Outlook and go
> back into your eMail Profile. But you cannot reopen Outlook with the SQL
> Mail profile while SQL Mail is using that profile, running. You have to
> stop SQL Mail then go into the SQL Mail Profile with Outlook then restart
> SQL Mail.
> --
> George Hester
> _________________________________
> "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> news:30265F89-8F2B-4296-8CDA-C577B9AEE5E7@.microsoft.com...
> > Yes, let me know what the workaround is!
> >
> >
> > Fred
> >
> > "George Hester" wrote:
> >
> > > Actually there is a workaround for this issue. Let me know if you want
> to
> > > hear how it is done and I can explain it to you.
> > >
> > > --
> > >
> > > George Hester
> > > _________________________________
> > > "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> > > news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> > > > It would appear that Outlook 2003 (and 2002) does not work with SQL
> Mail,
> > > > unless you are using an Exchange Server. The SQL Mail program and
> Outlook
> > > > 2003 *BOTH* try to open the Personal Folder file (.pst file) and one
> of
> > > them
> > > > fails.
> > > >
> > > > If I close the Outlook 2003 client, SQL Mail works fine, except that
> the
> > > > mail does not go out! The mail only goes out when the Outlook client
> is
> > > > running and since the .pst file is locked, it only runs when SQL Mail
> is
> > > > disabled!
> > > >
> > > > So I can't generate email alerts in SQL unless I close down Outlook
> and I
> > > > can't get those alerts to go out unless I disable SQL Mail. What a
> crappy
> > > > setup! ... or am I missing something?
> > > >
> > > >
> > >
> > >
>

Outlook 2003 does not work with SQL Mail !

It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
unless you are using an Exchange Server. The SQL Mail program and Outlook
2003 *BOTH* try to open the Personal Folder file (.pst file) and one of them
fails.
If I close the Outlook 2003 client, SQL Mail works fine, except that the
mail does not go out! The mail only goes out when the Outlook client is
running and since the .pst file is locked, it only runs when SQL Mail is
disabled!
So I can't generate email alerts in SQL unless I close down Outlook and I
can't get those alerts to go out unless I disable SQL Mail. What a crappy
setup! ... or am I missing something?No you are not. That is the way it is. If you want trouble free SQL Mail
with Outlook you must use Outlook 2000. Otherwise you will run into Access
denied erros in the MAPI subsystem. That is because SQL Mail does not
release MAPI. You have to shut down the SQL Server Service. Fire up
Outlook then restart the SQL Service but as soon as SQL Mail acts once you
will be right back to the MAPI access deniied errors.
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> unless you are using an Exchange Server. The SQL Mail program and Outlook
> 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
them
> fails.
> If I close the Outlook 2003 client, SQL Mail works fine, except that the
> mail does not go out! The mail only goes out when the Outlook client is
> running and since the .pst file is locked, it only runs when SQL Mail is
> disabled!
> So I can't generate email alerts in SQL unless I close down Outlook and I
> can't get those alerts to go out unless I disable SQL Mail. What a crappy
> setup! ... or am I missing something?
>|||Actually there is a workaround for this issue. Let me know if you want to
hear how it is done and I can explain it to you.
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> It would appear that Outlook 2003 (and 2002) does not work with SQL Mail,
> unless you are using an Exchange Server. The SQL Mail program and Outlook
> 2003 *BOTH* try to open the Personal Folder file (.pst file) and one of
them
> fails.
> If I close the Outlook 2003 client, SQL Mail works fine, except that the
> mail does not go out! The mail only goes out when the Outlook client is
> running and since the .pst file is locked, it only runs when SQL Mail is
> disabled!
> So I can't generate email alerts in SQL unless I close down Outlook and I
> can't get those alerts to go out unless I disable SQL Mail. What a crappy
> setup! ... or am I missing something?
>|||Yes, let me know what the workaround is!
Fred
"George Hester" wrote:

> Actually there is a workaround for this issue. Let me know if you want to
> hear how it is done and I can explain it to you.
> --
> George Hester
> _________________________________
> "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> news:6866961B-7F29-443E-B6D3-132E20B66E95@.microsoft.com...
> them
>|||OK. What you do is set 2 Profiles in Microsoft Outlook. You will get your
eMail in one profile and the other will receive your SQL Alerts. The SQL
Mail holds on to the MAPI service. This is the reason for the error. So if
you start Outlook with your SQL Mail profile before SQL Mail starts then
start SQL Mail you will get your alerts. You can then close Outlook and go
back into your eMail Profile. But you cannot reopen Outlook with the SQL
Mail profile while SQL Mail is using that profile, running. You have to
stop SQL Mail then go into the SQL Mail Profile with Outlook then restart
SQL Mail.
George Hester
_________________________________
"fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
news:30265F89-8F2B-4296-8CDA-C577B9AEE5E7@.microsoft.com...[vbcol=seagreen]
> Yes, let me know what the workaround is!
>
> Fred
> "George Hester" wrote:
>
to[vbcol=seagreen]
Mail,[vbcol=seagreen]
Outlook[vbcol=seagreen]
of[vbcol=seagreen]
the[vbcol=seagreen]
is[vbcol=seagreen]
is[vbcol=seagreen]
and I[vbcol=seagreen]
crappy[vbcol=seagreen]|||Sorry George, you lost me there. The problem I have with Outlook 2003 and SQ
L
alerts is that the SQL alerts are generated, but don't go out unless Outlook
is running.
I am not sure how having two mail profiles will help. I have tried setting
up an Outlook email profile (say OutlookMail) and a SQL email profile (say
SQLMail). If I then set up SQL Alerts to use the SQLMail profile and launch
Outlook using the OutlooMail profile, everything works, *except* that the
alerts are generated, but don't go out!
Just having Outlook running (with the OutlookMail profile) does not seem to
help the SQL alerts. They are not going out, because the SQLMail profile's
mailbox (.pst file) is not being processed, only the OutlookMail mailbox is.
Did I miss something? I even tried setting up the OutlookMail profile in
Outlook to read and process the SQLMail profile's mail file, but that did no
t
work either.
Help !!
"George Hester" wrote:

> OK. What you do is set 2 Profiles in Microsoft Outlook. You will get you
r
> eMail in one profile and the other will receive your SQL Alerts. The SQL
> Mail holds on to the MAPI service. This is the reason for the error. So
if
> you start Outlook with your SQL Mail profile before SQL Mail starts then
> start SQL Mail you will get your alerts. You can then close Outlook and g
o
> back into your eMail Profile. But you cannot reopen Outlook with the SQL
> Mail profile while SQL Mail is using that profile, running. You have to
> stop SQL Mail then go into the SQL Mail Profile with Outlook then restart
> SQL Mail.
> --
> George Hester
> _________________________________
> "fredscuba" <fredscuba@.discussions.microsoft.com> wrote in message
> news:30265F89-8F2B-4296-8CDA-C577B9AEE5E7@.microsoft.com...
> to
> Mail,
> Outlook
> of
> the
> is
> is
> and I
> crappy
>

Monday, March 12, 2012

osql will not come up MSDE (sp3) or earlier

When I try to run osql, I get the following error:
c:\program files\Microsoft SQL Server\80\Tools\Binn\

> osql -E -d CCOP or osql -U sa -P AStrongPassword -d CCOP
[Shared Memory]SQL Server does not exist or access denied.
[Shared Memory]ConnectionOpen (Connect()).
I can start the instance "CCOP" from sqlmangr without any
issue, but when I try to run osql against the database, I
can never get past the startup
-d is the switch for the database name, not the instance name. Use the -S
switch to specify the instance name.
If you are not sure of the instance name, issue a osql -L for a list of SQL
Server instances.
See
http://msdn.microsoft.com/library/de...ta_01_2r1e.asp
for more information on running the osql utility.
Terri Morton
MVP - ASP/ASP.NET
"Ed H" <anonymous@.discussions.microsoft.com> wrote in message
news:0f4301c4ff5e$4c209930$a401280a@.phx.gbl...
> When I try to run osql, I get the following error:
> c:\program files\Microsoft SQL Server\80\Tools\Binn\
>
> [Shared Memory]SQL Server does not exist or access denied.
> [Shared Memory]ConnectionOpen (Connect()).
> I can start the instance "CCOP" from sqlmangr without any
> issue, but when I try to run osql against the database, I
> can never get past the startup
|||
>--Original Message--
>-d is the switch for the database name, not the instance
name. Use the -S
>switch to specify the instance name.
>If you are not sure of the instance name, issue a osql -
L for a list of SQL
>Server instances.
>See
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/acdata/ac_8_mta_01_2r1e.asp
>for more information on running the osql utility.
>Terri Morton
>MVP - ASP/ASP.NET
>"Ed H" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:0f4301c4ff5e$4c209930$a401280a@.phx.gbl...
CCOP[vbcol=seagreen]
denied.[vbcol=seagreen]
any[vbcol=seagreen]
database, I
>
>.
> Thx Terri. I had to re-install amoung other things.
The MSDN Help was a very valuable.

Friday, March 9, 2012

OSQL returns error code of 1 - intermittently

Hello,
I've written an program that runs OSQL to set up a database. I got a weird
situation yesterday where OSQL returns an error level of 1 and didn't
generate any output file at all. The command I use is:
OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
Normally, this command runs OK and produces a .log file. Why would it
return 1 and no log file?
I call OSQL from a Borland Builder C++ program.
Any ideas?
Regards,
Robert
PS: I ran the OSQL command straight after I installed MSDE and started up
SQL Server.Hi,
you are assuming some things:
OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
-E are you really able to use integrated authentication, if not you
have to provide a user name and a password. Perhaps you are running
your program under a special account which isn=B4t priviledged in the
database ?!
-i Are you in the right folder that SOQL can find the query file while
executing the file from the program ?
(missing -S) If you don=B4t specify a server, the default behaviour is
to go to the local server, the default instance, to the default port
1433. If this is not valid, you have to define the server/indtance,port
e=2Eg. Servername\instancename,Port.
HTH, Jens Suessmeyer.|||Hi,
Thanks for your reply.
OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
-E are you really able to use integrated authentication, if not you
have to provide a user name and a password. Perhaps you are running
your program under a special account which isnt priviledged in the
database ?!
I think so. I am running as (machine) administrator when I execute OSQL
-i Are you in the right folder that SOQL can find the query file while
executing the file from the program ?
The SetupRTEDatabase.sql script is in the same directory as the calling
program.
(missing -S) If you dont specify a server, the default behaviour is
to go to the local server, the default instance, to the default port
1433. If this is not valid, you have to define the server/indtance,port
e.g. Servername\instancename,Port.
This is OK. I run OSQL pretty much straight after I do an install of SQL
Server. I don't change any of the default settings.
Regards,
Robert|||I've fixed the problem.
As it turns out, I was running the program in the wrong folder after all.
OSQL was being run (indirectory) from a Setup program which ran on a network
drive.
I did a ChangeDirectory to the path with the SetupRTEDatabase.sql script and
everything worked fine.
"Robert Wheadon" <robert.wheadon@.monitorbm.co.nz> wrote in message
news:uC$01qrTGHA.5108@.TK2MSFTNGP11.phx.gbl...
> Hi,
> Thanks for your reply.
> OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
> -E are you really able to use integrated authentication, if not you
> have to provide a user name and a password. Perhaps you are running
> your program under a special account which isnt priviledged in the
> database ?!
> I think so. I am running as (machine) administrator when I execute OSQL
> -i Are you in the right folder that SOQL can find the query file while
> executing the file from the program ?
> The SetupRTEDatabase.sql script is in the same directory as the calling
> program.
> (missing -S) If you dont specify a server, the default behaviour is
> to go to the local server, the default instance, to the default port
> 1433. If this is not valid, you have to define the server/indtance,port
> e.g. Servername\instancename,Port.
> This is OK. I run OSQL pretty much straight after I do an install of SQL
> Server. I don't change any of the default settings.
> Regards,
> Robert
>

Wednesday, March 7, 2012

OSQL fails silently

Hello,
I have a InstallShield program that installs MSDE and then creates a new
database in it. To set up the new database on MSDE I run OSQL. Most of the
time, OSQL works OK. But, sometimes it fails and doesn't print out any
error messages (in the output file).
Has anyone seen this intermittant silent failure behavior before?
The OSQL command I use is:
OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
Regards,
RobertHi Robert
You don't say if you check ERRORLEVEL after the call?
How large the input file?
Have you tried the -e parameter to see the commands?
John
"Robert Wheadon" wrote:

> Hello,
> I have a InstallShield program that installs MSDE and then creates a new
> database in it. To set up the new database on MSDE I run OSQL. Most of t
he
> time, OSQL works OK. But, sometimes it fails and doesn't print out any
> error messages (in the output file).
> Has anyone seen this intermittant silent failure behavior before?
> The OSQL command I use is:
> OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
> Regards,
> Robert
>
>|||Hello John,

> You don't say if you check ERRORLEVEL after the call?
>
Yes, I do. When OSQL decides to fail, I get an ERRORLEVEL of 1.

> How large the input file?
>
10 KB

> Have you tried the -e parameter to see the commands?
>
No. I hadn't thought of that.|||Hi
Non zero values of ERRORLEVEL indicate and error. Have you checked the
output for Msg?
OSQL can have issues with larger files, you may want to split your script
into multiple files and run them separately.
You may also want to specify -n to get cleaner output.
John
"Robert Wheadon" wrote:

> Hello John,
>
> Yes, I do. When OSQL decides to fail, I get an ERRORLEVEL of 1.
>
> 10 KB
>
> No. I hadn't thought of that.
>
>|||I've sorted this one out. See my post "OSQL returns error code of 1 -
intermittently.
SysInternals' FileMonitor and ProcessMonitor tools were helpful in finding
the problem.
"Robert Wheadon" <robert.wheadon@.monitorbm.co.nz> wrote in message
news:eslJ5B3UGHA.4772@.TK2MSFTNGP14.phx.gbl...
> Hello John,
>
> Yes, I do. When OSQL decides to fail, I get an ERRORLEVEL of 1.
>
> 10 KB
>
> No. I hadn't thought of that.
>