Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Thursday, March 22, 2012

Escape characters

What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.
Hi
In as search condition there is the ESCAPE clause that allows you to specify
the escape character, you can also specify a literal character by using
square brackets.
See the topic "Pattern Matching in Search Conditions" in Books online.
When you are inserting the characters there should not be a need to escape
them e.g
CREATE TABLE #fred ( col1 varchar(10) )
INSERT INTO #fred values ( '%_*' )
INSERT INTO #fred select '%_*'
select * from #fred
col1
%_*
%_*
John
"Sathyaish" wrote:

> What should one pass as a field value into a table in the insert
> statement if the value contained a percentage symbol (%) or the
> asterisk symbol (*), since both of these have special wildcard
> meanings. What if I want to pass the special meanings and pass them as
> literals? Is there any escape character that I must use? I am using
> ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
> SQL Server 2000.
>
|||While INSERTing data, you can simply pass data containig % inside single
quotes. % has a meaning in the context of LIKE, not in INSERT.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Sathyaish" <sathyaish@.gmail.com> wrote in message
news:1125988873.864860.108830@.g44g2000cwa.googlegr oups.com...
What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.

Escape characters

What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.Hi
In as search condition there is the ESCAPE clause that allows you to specify
the escape character, you can also specify a literal character by using
square brackets.
See the topic "Pattern Matching in Search Conditions" in Books online.
When you are inserting the characters there should not be a need to escape
them e.g
CREATE TABLE #fred ( col1 varchar(10) )
INSERT INTO #fred values ( '%_*' )
INSERT INTO #fred select '%_*'
select * from #fred
col1
--
%_*
%_*
John
"Sathyaish" wrote:
> What should one pass as a field value into a table in the insert
> statement if the value contained a percentage symbol (%) or the
> asterisk symbol (*), since both of these have special wildcard
> meanings. What if I want to pass the special meanings and pass them as
> literals? Is there any escape character that I must use? I am using
> ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
> SQL Server 2000.
>|||While INSERTing data, you can simply pass data containig % inside single
quotes. % has a meaning in the context of LIKE, not in INSERT.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Sathyaish" <sathyaish@.gmail.com> wrote in message
news:1125988873.864860.108830@.g44g2000cwa.googlegroups.com...
What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.

Escape characters

What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.Hi
In as search condition there is the ESCAPE clause that allows you to specify
the escape character, you can also specify a literal character by using
square brackets.
See the topic "Pattern Matching in Search Conditions" in Books online.
When you are inserting the characters there should not be a need to escape
them e.g
CREATE TABLE #fred ( col1 varchar(10) )
INSERT INTO #fred values ( '%_*' )
INSERT INTO #fred select '%_*'
select * from #fred
col1
--
%_*
%_*
John
"Sathyaish" wrote:

> What should one pass as a field value into a table in the insert
> statement if the value contained a percentage symbol (%) or the
> asterisk symbol (*), since both of these have special wildcard
> meanings. What if I want to pass the special meanings and pass them as
> literals? Is there any escape character that I must use? I am using
> ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
> SQL Server 2000.
>|||While INSERTing data, you can simply pass data containig % inside single
quotes. % has a meaning in the context of LIKE, not in INSERT.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Sathyaish" <sathyaish@.gmail.com> wrote in message
news:1125988873.864860.108830@.g44g2000cwa.googlegroups.com...
What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.sql

Escape characters

What should one pass as a field value into a table in the insert
statement if the value contained a percentage symbol (%) or the
asterisk symbol (*), since both of these have special wildcard
meanings. What if I want to pass the special meanings and pass them as
literals? Is there any escape character that I must use? I am using
ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
SQL Server 2000.Replied in Micorsoft.public.sqlserver.server please do not multi-post.

http://www.aspfaq.com/etiquette.asp?id=5003
http://www.aspfaq.com/show.asp?id=2081
http://www.aspfaq.com/etiquette.asp?id=5006

John
"Sathyaish" <sathyaish@.gmail.com> wrote in message
news:1125988847.238366.259770@.g47g2000cwa.googlegr oups.com...
> What should one pass as a field value into a table in the insert
> statement if the value contained a percentage symbol (%) or the
> asterisk symbol (*), since both of these have special wildcard
> meanings. What if I want to pass the special meanings and pass them as
> literals? Is there any escape character that I must use? I am using
> ADO.NET v1.1 of the framework with VB.NET. The database is Microsoft
> SQL Server 2000.

escape character if the field name has ? in it

HI All,
I'm using SQL server 2000 and SQL Server JDBC driver to connect to it.
I have a field name which has a ? in it. For eg field?
In the query analyzer when i execute the following query
select field? from qtable. It executes successfully. In the Java code
I tried the same like ResultSet rs = stmt.executeQuery("Select field? from
qtable");
The following exceptions was thrown [Microsoft][SQLServer 2000 Driv
er for JDBC][SQLServer]Invalid column name 'field@.P1'.
Any inputs on escape sequence will be highly appreciated.
Thanks,
Prabhu.This is some substitution done by the JDBC driver. I suggest you post this
to a JDBC group. Or, better, don't use "strange" characters in identifiers.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Prabhu" <prabhu_mpp@.lycos.com> wrote in message
news:C5537E35-83B0-4F74-880C-EBC51A95F8D2@.microsoft.com...
> HI All,
> I'm using SQL server 2000 and SQL Server JDBC driver to connect to it.
> I have a field name which has a ? in it. For eg field?
> In the query analyzer when i execute the following query
> select field? from qtable. It executes successfully. In the Java code
> I tried the same like ResultSet rs = stmt.executeQuery("Select field?
from qtable");
> The following exceptions was thrown [Microsoft][SQLServer 2000 Driver for

JDBC][SQLServer]Invalid column name 'field@.P1'.
> Any inputs on escape sequence will be highly appreciated.
> Thanks,
> Prabhu.|||Don't do Java anymore so can't try it, but have you tried something like
"select [field?] from qtable"?
"Prabhu" <prabhu_mpp@.lycos.com> wrote in message
news:C5537E35-83B0-4F74-880C-EBC51A95F8D2@.microsoft.com...
> HI All,
> I'm using SQL server 2000 and SQL Server JDBC driver to connect to it.
> I have a field name which has a ? in it. For eg field?
> In the query analyzer when i execute the following query
> select field? from qtable. It executes successfully. In the Java code
> I tried the same like ResultSet rs = stmt.executeQuery("Select field?
from qtable");
> The following exceptions was thrown [Microsoft][SQLServer 2000 Driver for

JDBC][SQLServer]Invalid column name 'field@.P1'.
> Any inputs on escape sequence will be highly appreciated.
> Thanks,
> Prabhu.|||Try enclosing the field name in square braces ie
select [field?] from qtable
Wayne Snyder MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
(Please respond only to the newsgroups.)
I support the Professional Association for SQL Server
(www.sqlpass.org)
"Prabhu" <prabhu_mpp@.lycos.com> wrote in message
news:C5537E35-83B0-4F74-880C-EBC51A95F8D2@.microsoft.com...
> HI All,
> I'm using SQL server 2000 and SQL Server JDBC driver to connect to it.
> I have a field name which has a ? in it. For eg field?
> In the query analyzer when i execute the following query
> select field? from qtable. It executes successfully. In the Java code
> I tried the same like ResultSet rs = stmt.executeQuery("Select field?
from qtable");
> The following exceptions was thrown [Microsoft][SQLServer 2000 Driver for

JDBC][SQLServer]Invalid column name 'field@.P1'.
> Any inputs on escape sequence will be highly appreciated.
> Thanks,
> Prabhu.|||Thanks alot for the responses, but the suggestion given did not solve the is
sue.Any other thoughts pls?
Seems to be JDBC related issue.
Thanks,
Prabhu

Sunday, March 11, 2012

Errors in SQL Server 2005 Profiler

I notice this running the SQL Server Profiler under the application name Report Server. Every time it runs, it reports an error (in the Error field of Profiler). Does anyone know what this is?

declare @.p1 nvarchar(64)
set @.p1=NULL
exec GetDBVersion @.DBVersion=@.p1 output
select @.p1

Do you mean when running Reporting Service (or just an application named Report Server?), you found errors with the statements you post? If you're talking about Reporting Service, take a look at this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=277072&SiteId=1

To understand the error, you may take a look at:

http://msdn2.microsoft.com/en-us/library/aa256379(SQL.80).aspx

Wednesday, March 7, 2012

Errorlog increase Message Field

Is there away to increase the number of characters the
line displays or writes out in the Message field within
SQL Server Enterprise Manager 2000. It would be very
helpful to resolve locking problems.
Thank You,
DanRight Click on the Message and choose properties option - it should display
the full text.
Else you can directly open the file from C:\Program Files\Microsoft SQL
Server\MSSQL\LOG.
Please replace the directory structure as per your installation.
HTH
Satish Balusa
Corillian Corp.
"Dan" <anonymous@.discussions.microsoft.com> wrote in message
news:76ad01c3e762$f3c39bc0$a501280a@.phx.gbl...
quote:

> Is there away to increase the number of characters the
> line displays or writes out in the Message field within
> SQL Server Enterprise Manager 2000. It would be very
> helpful to resolve locking problems.
> Thank You,
> Dan
>
>
|||Hi,
Best idea is to run the below command from Query Analyzer, This will display
the entire contents of current SQL error log.
xp_readerrorlog
Thanks
Hari
MCDBA
"Dan" <anonymous@.discussions.microsoft.com> wrote in message
news:76ad01c3e762$f3c39bc0$a501280a@.phx.gbl...
quote:

> Is there away to increase the number of characters the
> line displays or writes out in the Message field within
> SQL Server Enterprise Manager 2000. It would be very
> helpful to resolve locking problems.
> Thank You,
> Dan
>
>

Errorlog increase Message Field

Is there away to increase the number of characters the
line displays or writes out in the Message field within
SQL Server Enterprise Manager 2000. It would be very
helpful to resolve locking problems.
Thank You,
DanRight Click on the Message and choose properties option - it should display
the full text.
Else you can directly open the file from C:\Program Files\Microsoft SQL
Server\MSSQL\LOG.
Please replace the directory structure as per your installation.
--
HTH
Satish Balusa
Corillian Corp.
"Dan" <anonymous@.discussions.microsoft.com> wrote in message
news:76ad01c3e762$f3c39bc0$a501280a@.phx.gbl...
> Is there away to increase the number of characters the
> line displays or writes out in the Message field within
> SQL Server Enterprise Manager 2000. It would be very
> helpful to resolve locking problems.
> Thank You,
> Dan
>
>|||Hi,
Best idea is to run the below command from Query Analyzer, This will display
the entire contents of current SQL error log.
xp_readerrorlog
Thanks
Hari
MCDBA
"Dan" <anonymous@.discussions.microsoft.com> wrote in message
news:76ad01c3e762$f3c39bc0$a501280a@.phx.gbl...
> Is there away to increase the number of characters the
> line displays or writes out in the Message field within
> SQL Server Enterprise Manager 2000. It would be very
> helpful to resolve locking problems.
> Thank You,
> Dan
>
>

ErrorColumn field from Datasource Error Output

Hi,

The problem is, ErrorColumn contains ID. Is the following code reference safe ?
columnname = Me.ComponentMetaData.InputCollection.FindObjectByID(Row.ErrorColumn).Name

Is there any possibility for FindObjectByID to return NULL Reference in any case ?In many cases ErrorColumn is NULL.|||It contains ID, how do I translate it to Column Name ?
I have defined names in connection manager.|||I don't believe you can.|||Why I couldnt ?

That sucks|||

Fahad349 wrote:

Why I couldnt ?

That sucks

Because the column ID is the metadata ID of the column in the previous component, not the current component. So the ID being passed in isn't in the current component's metadata.

Indeed it isn't the best situation.

|||Dang on SQL Server team

Is there any harder way to do it ?|||

Fahad349 wrote:

Dang on SQL Server team

Is there any harder way to do it ?

You are welcome to submit a feature request: http://connect.microsoft.com/sqlserver/feedback

Friday, February 24, 2012

ERROR: There is no data for the field at position 20

This error is displaying in the log file just prior to this entry:
ERROR: Internal error: System.Web.HttpException: Cannot redirect after HTTP
headers have been sent.
The report is being called and displayed using the out of the box Report
Manager with all current updates. It is a periodic problem with the
user-facing error displaying smack dab in the middle of the page in a middle
column of the report.
Can anyone provide any help in resolving this intermittent issue?I had the same problem.
We are using an alias for our server name and the following file was causing
it to redirect in the background to the real server name which was causing
authentication to fail especially through the proxies.
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportManager\rswebapplication.config
hth
Dave
"ToxicDice" wrote:
> This error is displaying in the log file just prior to this entry:
> ERROR: Internal error: System.Web.HttpException: Cannot redirect after HTTP
> headers have been sent.
> The report is being called and displayed using the out of the box Report
> Manager with all current updates. It is a periodic problem with the
> user-facing error displaying smack dab in the middle of the page in a middle
> column of the report.
> Can anyone provide any help in resolving this intermittent issue?|||Thanks Dave. We in fact are aliasing the site and that config file does have
the real name. I'll change it to the alias and see if we still encounter the
problem. Thanks for the help!

Wednesday, February 15, 2012

Error: Subreport could not be shown

I've got a report with subreport, passing an id field from the main to the
sub, working fine in report designer, but when I upload and view the report
on the reportserver, I get "Error: Subreport could not be shown" on each
line where I would expect to see subreport data.
How stoopid am I being? I can't find any mentions of this error message on
MSDN, Books Online, general google search etc.
Anyone with any ideas?
--
Regards
Paul Paintinhowdy - did you get this problem sorted out? I am having exactly the same problem and cannot for the life of me find any documentation on the net to fix it!!!!
Please reply if you found out what the hell to do
cheers
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.