Showing posts with label version. Show all posts
Showing posts with label version. Show all posts

Friday, March 30, 2012

long SQL lines for osql

We have a very long and complicated SQL script which we run to upgrade
a version of our software from old to new. It works great in Query
Analyzer, but when run through osql it takes errors on lines that are
very long and (I think) stops reading after a certain amount of
characters. I've searched the net but haven't found anyone mentioning
this before. I have tried the -w 5000 parm to no avail.

Any suggestions?pb648174 (google@.webpaul.net) writes:
> We have a very long and complicated SQL script which we run to upgrade
> a version of our software from old to new. It works great in Query
> Analyzer, but when run through osql it takes errors on lines that are
> very long and (I think) stops reading after a certain amount of
> characters. I've searched the net but haven't found anyone mentioning
> this before. I have tried the -w 5000 parm to no avail.

-w controls the width of the output. As I understand it, you have
problems with the input.

One thing to keep in mind, is by default OSQL runs with QUOTED_IDENTIFIER
off, which is different from Query Analyzer. Run with -I to change this.

It would have helped if you had included any error messages.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||The error messages are bogus, i.e. it is stopping processing in the
middle of a line, i.e. "Ad" is not a column, when the line is doing
something with "Address". I'll try the -l option and see if that makes
a difference, but it doesn't seem like it would make a difference since
I am using standard name, i.e. nothing with brackets, quotes or spaces
in the names.|||pb648174 (google@.webpaul.net) writes:
> The error messages are bogus, i.e. it is stopping processing in the
> middle of a line, i.e. "Ad" is not a column, when the line is doing
> something with "Address". I'll try the -l option and see if that makes
> a difference, but it doesn't seem like it would make a difference since
> I am using standard name, i.e. nothing with brackets, quotes or spaces
> in the names.

OK, it sounds like it chokes on something.

It could be the file size, but it could also be the batch size.

If it is the file size, you can split the file into several and then
include the files with ~r. (Well, maybe. It could choke on the total.
But you could try.)

If it is the batch size, maybe you can throw in more "go" of you have
very long batches.

I recall that we had an issue with INSERT-files that we generate
from Excel. I had to fix the tool, so that it added a "go" after
each 40th EXEC or so. But if memory serves, it was the ISQL/W 6.5
that had this problems.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||I haven't been able to reproduce it locally - it always happens during
our production push... Then I have to execute it in QA for every
database we have which is a pain. The total file size is about 2 MB and
there is a go after pretty much each statement.

Erland Sommarskog wrote:
> pb648174 (google@.webpaul.net) writes:
> > The error messages are bogus, i.e. it is stopping processing in the
> > middle of a line, i.e. "Ad" is not a column, when the line is doing
> > something with "Address". I'll try the -l option and see if that makes
> > a difference, but it doesn't seem like it would make a difference since
> > I am using standard name, i.e. nothing with brackets, quotes or spaces
> > in the names.
> OK, it sounds like it chokes on something.
> It could be the file size, but it could also be the batch size.
> If it is the file size, you can split the file into several and then
> include the files with ~r. (Well, maybe. It could choke on the total.
> But you could try.)
> If it is the batch size, maybe you can throw in more "go" of you have
> very long batches.
> I recall that we had an issue with INSERT-files that we generate
> from Excel. I had to fix the tool, so that it added a "go" after
> each 40th EXEC or so. But if memory serves, it was the ISQL/W 6.5
> that had this problems.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx

Friday, March 23, 2012

Logshipping Monitor does not work correctly

Hi all,
1st, I must say that I use the German Version of SQL Server. So I am
not sure if I translate the SQL features correctly to English.
I spent some time today setting up Log Shipping between 2 SQL Servers.
I used a Whitepaper I found at the microsoft.com Website.
Log Shipping seems to work fine. When I change Data on Server 1 I can
see the changes on Server 2 after the Logs are applied.
But I have one thing that doesnt work. And its the Logshipping
Monitor in the Enterprise Manager. When i open the Log shipping Pair
Properties and look at "last file copied" and "last file loaded" it
just shows first_file_000*.trn.
After 30 Minutes the Logshipping Monitor turns red and says that there
is an Error. But there isnt (not in the Shipping itself, I am sure
because it works!).
I dont know whats wrong here. The SQL Server runs as Local System on
both Sites. The SQL Agent uses a Domain Account which has SA rights on
the SQL Servers, Admin Rights on the Machines and Read / Write
privileges on the Fileshares where the Transaction Logs are copied.
I hope somebody can help here.
Thank you very much in advance,
Rene
On Tue, 22 Nov 2005 20:08:56 +0100, Rene Buedinger
<rbuedinger@.wz.xagxx> wrote:
Hi all,
OK I got it! My SQL Server Services where running as LocalSystem.
Because the Monitoring was running on the Primary Server, the
Secondary Server could not alter the Table log_shipping_secondaries.
After I started the SQL Server with a Domain Account which has the
necessary Rights on the Primary Server the log_shipping_secondaries
Table was altered and the Error went away.
Maybe this helps some others when they get the same Error.
Greetings,
Ren

Monday, February 20, 2012

Login Problem

what error are you getting ? What version of sql server
and windows are you running ?
Just a guess, this may be a network, are you able to ping
the sql server from your pc, also try running following
command on a DOS command prompt:
telnet <yoursqlservername> 1433
you should get a blank screen, if you get an error then
more likely this is a network issue.
hth.

>--Original Message--
>Hi All,
>I am not able to login into my SQL Server using Query
Analyser using a valid SA Password. But My web application
is working fine.
>Any Idea why it is happening.
>Thanks & Regards
>Balaji Prabhu.T
>.
>Hi,
I feel that you are using "Windows Only" authentication mode. In that case
you cant login using SQL server authentication with SA user.
How to check and change
1. Open Enterprise manger
2. Right click above the server and select properties
3. Select Security Tab
4. Check the Authentication, If it is Windows Only then
click "SQL Server and Windows"
5. Restart SQL server and try connecting.
Thanks
Hari
MCDBA
<anonymous@.discussions.microsoft.com> wrote in message
news:c2fd01c4085c$3cb75dc0$a101280a@.phx.gbl...
> what error are you getting ? What version of sql server
> and windows are you running ?
> Just a guess, this may be a network, are you able to ping
> the sql server from your pc, also try running following
> command on a DOS command prompt:
> telnet <yoursqlservername> 1433
> you should get a blank screen, if you get an error then
> more likely this is a network issue.
> hth.
>
> Analyser using a valid SA Password. But My web application
> is working fine.