Showing posts with label line. Show all posts
Showing posts with label line. Show all posts

Thursday, March 29, 2012

getting a double line as underline

nead to show a double line just below a word

is there any upper double line symbol.
i saw a double line but it is in middle.

i am using this symbol with sql.

so i need that symbol to be upper

ie
select replicate('n'?',10)
??????????
like this
IS there NO WAY OF GETTING upper DOUBLE LINE not middle
it is difficult in my case because of the complexity of my sp and my client requirement.You should do formatting on the client-side not on the database. There are lot of limitations on the server-side in terms of formatting. You could use the Windows CharMap utility to look for characters that match the double line and see if you can use it.sql

Friday, March 9, 2012

Get the error in dos cmd line

Hi everyone,

I have a cmd file that executes sql statements:

something like this:

Code Snippet

OSQL -S %sqlServer% -E -b -n -i DATABASE.sql"
IF ERRORLEVEL 1 GOTO error
echo -

...

:error
@.ECHO An error occured in [%errorLevel%]
echo [%errorLevel%] > %1

GOTO EXIT


if there is an error, I print the errorlevel in a txt file wich is a parameter in the command (%1)

What I want is: instead of sending the %errorlevel% to the txt, I want to send the error description but I don't know the variable that keeps the error description.

Any help please

Thanx in advance

I really need to know if there is some variable that gives me the sql error because when I execute the cmd, if there's an error

the error is printed int the cmd window.

The errorlevel var just give me the number "1" but I would like to get something like

"An error in database ocurred due to database already exists" or something like that.

Please I'll apreciate any ideias you may have
|||

Instead of overwriting the error log file, I would just append the error to the file instead.

Code Snippet

ECHO OFF

OSQL -S %sqlServer% -E -b -n -i test.sql > %1
IF ERRORLEVEL 1 GOTO error
ECHO "" > %1
EXIT


:error
@.ECHO An error occured in [%errorLevel%]
echo [%errorLevel%] >> %1

This way you either have a blank file, or you have a file with an error message and errorLevel code.

|||Thanx for the answer ShawnNWF, that will do the trick for sure

Get the error in dos cmd line

Hi everyone,

I have a cmd file that executes sql statements:

something like this:

Code Snippet

OSQL -S %sqlServer% -E -b -n -i DATABASE.sql"
IF ERRORLEVEL 1 GOTO error
echo -

...

:error
@.ECHO An error occured in [%errorLevel%]
echo [%errorLevel%] > %1

GOTO EXIT


if there is an error, I print the errorlevel in a txt file wich is a parameter in the command (%1)

What I want is: instead of sending the %errorlevel% to the txt, I want to send the error description but I don't know the variable that keeps the error description.

Any help please

Thanx in advance

I really need to know if there is some variable that gives me the sql error because when I execute the cmd, if there's an error

the error is printed int the cmd window.

The errorlevel var just give me the number "1" but I would like to get something like

"An error in database ocurred due to database already exists" or something like that.

Please I'll apreciate any ideias you may have
|||

Instead of overwriting the error log file, I would just append the error to the file instead.

Code Snippet

ECHO OFF

OSQL -S %sqlServer% -E -b -n -i test.sql > %1
IF ERRORLEVEL 1 GOTO error
ECHO "" > %1
EXIT


:error
@.ECHO An error occured in [%errorLevel%]
echo [%errorLevel%] >> %1

This way you either have a blank file, or you have a file with an error message and errorLevel code.

|||Thanx for the answer ShawnNWF, that will do the trick for sure