Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Monday, March 26, 2012

Incorrect syntax near keyword "function".

First a little history:
We have a Pentium II server running SQL 7.0. The SQL has a database that
our users connect to using a client front end app that was created by a
former programmer in our office. The file server name in the beginning was
called FRE3.
In the beginning the server was running NT4 and the users were on Win95
desktops.
We had a migration a few years ago where the server was upgraded to Windows
2000 server and the desktops were upgraded to Windows 2000 Professional. We
also had to make a server name change to fall in line with official naming
conventions. The server's name was changed to NTFRE. It was and still is
just a member server in our AD.
Of course, the client app had to be modified as it refers to the server name
and us non-programmers figured out how to change the name in the Visual Basic
code and recompiled a new executable and it worked fine. Just had to change
one instance in the code where it names the server.
We are now going through a new migration. We have a new box and have
installed Windows Server 2003 Enterprise on it. We have also installed SQL
2000 on it. Have updated all service packs and everything. Ran the copy
database wizard and successfully brought over the database from the SQL 7.0
server, as well as user logins. User destops are being migrated to Windows
XP as well.
So we broke into the code again, and changed the server name again like last
time, (new 2003 server is called S2K3-FRE-SQL1), and recompiled a new
executable.
Houston, we now have a problem. When I executed new executable on new XP
machine, I get this error message after logging in:
Run Time Error - '2147217900(80040e14)
Incorrect syntax near keyword 'function'
Does this error message mean anything to any of you gurus?
There is one bit of info that I need to relay, not sure if it matters or not:
The old server running 7.0, in Enterprise Manager, under SQL Server Group,
it states 2KFRE (Windows NT).
In the new server running 2000, in Enterprise Manager, under SQL Server
Group, it does not state the name of the server (S2K3-FRE-SQL1), it just
states Local (Windows NT).
Should I worry about this? Is the code looking for S2K3-FRE-SQL1 and seeing
the word Local instead, thus giving me my error message'?
Do you believe that the client code needs to be modified somewhere else now'
Is this error message a reflection of code built to address a SQL 7.0
installation and now it doesn't work as it's trying to talk to a SQL 2000
installation'Hi
function is a keyword so can't be used in the code. You may want to use the
scripting options of Enterprise Manager to script out the stored procedures
to try a textual search for function and see where it occurs. It could be
that you also have triggers which may contain the the key word. Alternatively
you could use SQL profiler to look at what SQL is being run on the server and
try and narrow down what is going on. If you want to look at
http://tinyurl.com/yejfye which is a MSDN webcast on using SQL 2000 Profiler,
there is also one for SQL 2005 and other tools.
You also have a lot of information in books online and it is certainly worth
your while browsing it.
HTH
John
"Rockitman" wrote:
> First a little history:
> We have a Pentium II server running SQL 7.0. The SQL has a database that
> our users connect to using a client front end app that was created by a
> former programmer in our office. The file server name in the beginning was
> called FRE3.
> In the beginning the server was running NT4 and the users were on Win95
> desktops.
> We had a migration a few years ago where the server was upgraded to Windows
> 2000 server and the desktops were upgraded to Windows 2000 Professional. We
> also had to make a server name change to fall in line with official naming
> conventions. The server's name was changed to NTFRE. It was and still is
> just a member server in our AD.
> Of course, the client app had to be modified as it refers to the server name
> and us non-programmers figured out how to change the name in the Visual Basic
> code and recompiled a new executable and it worked fine. Just had to change
> one instance in the code where it names the server.
> We are now going through a new migration. We have a new box and have
> installed Windows Server 2003 Enterprise on it. We have also installed SQL
> 2000 on it. Have updated all service packs and everything. Ran the copy
> database wizard and successfully brought over the database from the SQL 7.0
> server, as well as user logins. User destops are being migrated to Windows
> XP as well.
> So we broke into the code again, and changed the server name again like last
> time, (new 2003 server is called S2K3-FRE-SQL1), and recompiled a new
> executable.
> Houston, we now have a problem. When I executed new executable on new XP
> machine, I get this error message after logging in:
> Run Time Error - '2147217900(80040e14)
> Incorrect syntax near keyword 'function'
>
> Does this error message mean anything to any of you gurus?
> There is one bit of info that I need to relay, not sure if it matters or not:
> The old server running 7.0, in Enterprise Manager, under SQL Server Group,
> it states 2KFRE (Windows NT).
> In the new server running 2000, in Enterprise Manager, under SQL Server
> Group, it does not state the name of the server (S2K3-FRE-SQL1), it just
> states Local (Windows NT).
> Should I worry about this? Is the code looking for S2K3-FRE-SQL1 and seeing
> the word Local instead, thus giving me my error message'?
> Do you believe that the client code needs to be modified somewhere else now'
> Is this error message a reflection of code built to address a SQL 7.0
> installation and now it doesn't work as it's trying to talk to a SQL 2000
> installation'
>
>sql

Incorrect syntax near keyword "function".

First a little history:
We have a Pentium II server running SQL 7.0. The SQL has a database that
our users connect to using a client front end app that was created by a
former programmer in our office. The file server name in the beginning was
called FRE3.
In the beginning the server was running NT4 and the users were on Win95
desktops.
We had a migration a few years ago where the server was upgraded to Windows
2000 server and the desktops were upgraded to Windows 2000 Professional. W
e
also had to make a server name change to fall in line with official naming
conventions. The server's name was changed to NTFRE. It was and still is
just a member server in our AD.
Of course, the client app had to be modified as it refers to the server name
and us non-programmers figured out how to change the name in the Visual Basi
c
code and recompiled a new executable and it worked fine. Just had to change
one instance in the code where it names the server.
We are now going through a new migration. We have a new box and have
installed Windows Server 2003 Enterprise on it. We have also installed SQL
2000 on it. Have updated all service packs and everything. Ran the copy
database wizard and successfully brought over the database from the SQL 7.0
server, as well as user logins. User destops are being migrated to Windows
XP as well.
So we broke into the code again, and changed the server name again like last
time, (new 2003 server is called S2K3-FRE-SQL1), and recompiled a new
executable.
Houston, we now have a problem. When I executed new executable on new XP
machine, I get this error message after logging in:
Run Time Error - '2147217900(80040e14)
Incorrect syntax near keyword 'function'
Does this error message mean anything to any of you gurus?
There is one bit of info that I need to relay, not sure if it matters or not
:
The old server running 7.0, in Enterprise Manager, under SQL Server Group,
it states 2KFRE (Windows NT).
In the new server running 2000, in Enterprise Manager, under SQL Server
Group, it does not state the name of the server (S2K3-FRE-SQL1), it just
states Local (Windows NT).
Should I worry about this? Is the code looking for S2K3-FRE-SQL1 and seeing
the word Local instead, thus giving me my error message'?
Do you believe that the client code needs to be modified somewhere else now?
?
Is this error message a reflection of code built to address a SQL 7.0
installation and now it doesn't work as it's trying to talk to a SQL 2000
installation'Hi
function is a keyword so can't be used in the code. You may want to use the
scripting options of Enterprise Manager to script out the stored procedures
to try a textual search for function and see where it occurs. It could be
that you also have triggers which may contain the the key word. Alternativel
y
you could use SQL profiler to look at what SQL is being run on the server an
d
try and narrow down what is going on. If you want to look at
http://tinyurl.com/yejfye which is a MSDN webcast on using SQL 2000 Profiler
,
there is also one for SQL 2005 and other tools.
You also have a lot of information in books online and it is certainly worth
your while browsing it.
HTH
John
"Rockitman" wrote:

> First a little history:
> We have a Pentium II server running SQL 7.0. The SQL has a database that
> our users connect to using a client front end app that was created by a
> former programmer in our office. The file server name in the beginning wa
s
> called FRE3.
> In the beginning the server was running NT4 and the users were on Win95
> desktops.
> We had a migration a few years ago where the server was upgraded to Window
s
> 2000 server and the desktops were upgraded to Windows 2000 Professional.
We
> also had to make a server name change to fall in line with official naming
> conventions. The server's name was changed to NTFRE. It was and still i
s
> just a member server in our AD.
> Of course, the client app had to be modified as it refers to the server na
me
> and us non-programmers figured out how to change the name in the Visual Ba
sic
> code and recompiled a new executable and it worked fine. Just had to chan
ge
> one instance in the code where it names the server.
> We are now going through a new migration. We have a new box and have
> installed Windows Server 2003 Enterprise on it. We have also installed SQ
L
> 2000 on it. Have updated all service packs and everything. Ran the copy
> database wizard and successfully brought over the database from the SQL 7.
0
> server, as well as user logins. User destops are being migrated to Window
s
> XP as well.
> So we broke into the code again, and changed the server name again like la
st
> time, (new 2003 server is called S2K3-FRE-SQL1), and recompiled a new
> executable.
> Houston, we now have a problem. When I executed new executable on new XP
> machine, I get this error message after logging in:
> Run Time Error - '2147217900(80040e14)
> Incorrect syntax near keyword 'function'
>
> Does this error message mean anything to any of you gurus?
> There is one bit of info that I need to relay, not sure if it matters or n
ot:
> The old server running 7.0, in Enterprise Manager, under SQL Server Grou
p,
> it states 2KFRE (Windows NT).
> In the new server running 2000, in Enterprise Manager, under SQL Server
> Group, it does not state the name of the server (S2K3-FRE-SQL1), it just
> states Local (Windows NT).
> Should I worry about this? Is the code looking for S2K3-FRE-SQL1 and seei
ng
> the word Local instead, thus giving me my error message'?
> Do you believe that the client code needs to be modified somewhere else no
w'
> Is this error message a reflection of code built to address a SQL 7.0
> installation and now it doesn't work as it's trying to talk to a SQL 2000
> installation'
>
>

Friday, March 23, 2012

Incorrect syntax near ?.

Hi Guys,

I have moved my asp.net app from access db over to MS SQL 2005 DB.

And I have got a slight problem when I go to view any product

for example if I type in the url ofhttp://domain.com/catalog/Details.aspx?AdNum=1

I get this error

Server Error in '/catalog' Application.
------------------------

Incorrect syntax near '?'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near '?'.

I have attached the details.aspx.

I await for some suggestions.

Thanks

Matthew

------

1<%@. Page MasterPageFile="Classy.master"Explicit="True" Language="VB" Debug="True" %>23<asp:Content runat="server" ID="HeaderContent" ContentPlaceHolderID="PageHeader">4Ad Detail - <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />5</asp:Content>67<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="Body" >89<script runat="server">10Sub Page_Load(ByVal SenderAs Object,ByVal EAs EventArgs)11If Not IsPostBackThen12 If Request.QueryString("AdNum") =""Then13 Response.Redirect("default.aspx")14End If15 EditLink.NavigateUrl ="confirm.aspx?AdNum=" & Request.QueryString("AdNum")16End If17 End Sub1819 Protected Sub DetailsView1_PageIndexChanging(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.DetailsViewPageEventArgs)2021End Sub22</script>2324  25 <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"26 CellPadding="4" DataKeyNames="AdNum" DataSourceID="SqlDataSource1" ForeColor="#333333"27 GridLines="None" Height="65px" Width="100%" Font-Names="Arial" Font-Size="8pt" OnPageIndexChanging="DetailsView1_PageIndexChanging">28 <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />29 <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />30 <Fields>31 <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />32 <asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />33 <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />34 <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />35 <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />36 <asp:TemplateField HeaderText="Email">37 <ItemTemplate>38 <asp:HyperLink ID="HyperLink1" runat="server" Text=Email NavigateUrl='<%# Eval("Email", "mailto:{0}") %>' />39 </ItemTemplate>40</asp:TemplateField>41 <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />42 </Fields>43 </asp:DetailsView>44<p><i>To respond to this ad, just click the email address45above to send the poster46 a message.</i></p>47If you created this ad, you can48<asp:hyperlink id="EditLink" runat="server" >edit or delete it.</asp:hyperlink> <br>49 <asp:SqlDataSource ID="SqlDataSource1" runat="server"50 ConnectionString="<%$ ConnectionStrings:classydbConnectionString %>"51 ProviderName="<%$ ConnectionStrings:classydbConnectionString.ProviderName %>"52 SelectCommand="SELECT * FROM [Ads] WHERE ([AdNum] = ?)">53 <SelectParameters>54 <asp:QueryStringParameter Name="AdNum" QueryStringField="AdNum" Type="Int32" />55 </SelectParameters>56 </asp:SqlDataSource>5758</asp:content>
When you use SQLDataSource, you need to use the named parameter instead of the "?" which is correct when you were using Access db. Change your SelectCommand to: SelectCommand="SELECT * FROM [Ads] WHERE ([AdNum] = @.AdNum)">|||

Thanks for your help, it now works.

|||

This piece of code is suppose to allow me to edit / delete records, I can update the info and press update but it doesn't update the database. And I can press Delete record and it doesn't delete the record out of the database.

I don't get any error messages.

Below is the code:

1<%@. Page MasterPageFile="Classy.master"Explicit="True" Language="VB" Debug="True" %>2<%@. ImportNamespace="System.Data" %>3<%@. ImportNamespace="System.Data.SqlClient" %>45<asp:Content runat="server" ID="HeaderContent" ContentPlaceHolderID="PageHeader">6Edit Ad</asp:Content>78<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="Body" >910<script runat="server">11Protected Sub DetailsView1_ItemUpdated(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.DetailsViewUpdatedEventArgs)12 Response.Redirect("default.aspx")13End Sub1415 Protected Sub DetailsView1_ItemDeleted(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.DetailsViewDeletedEventArgs)16 Response.Redirect("default.aspx")17End Sub1819 Protected Sub DetailsView1_ItemCommand(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.DetailsViewCommandEventArgs)20If e.CommandName ="Cancel"Then21 Response.Redirect("default.aspx")22End If23 End Sub24</script>2526To make changes, click Edit, make your changes, then click Update.To delete27 this ad, just click the Delete button.28 <br />29 <br />30<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="100%" AutoGenerateRows="False" DataKeyNames="AdNum" DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None" OnItemUpdated="DetailsView1_ItemUpdated" OnItemDeleted="DetailsView1_ItemDeleted" OnItemCommand="DetailsView1_ItemCommand">31 <Fields>32 <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />33 <asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />34 <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />35 <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />36 <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />37 <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />38 <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />39 <asp:BoundField DataField="UserPassword" HeaderText="UserPassword" SortExpression="UserPassword" />40 <asp:CommandField ButtonType="Button" ShowDeleteButton="True" ShowEditButton="True" />41 </Fields>42 <RowStyle BackColor="#FFFBD6" />43 <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />44</asp:DetailsView>45 46<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"47 ConnectionString="<%$ ConnectionStrings:classydbConnectionString %>"48 DeleteCommand="DELETE FROM [Ads] WHERE [AdNum] = @.AdNum AND [Title] = @.Title AND [Category] = @.Category AND [Description] = @.Description AND [Price] = @.Price AND [Phone] = @.Phone ANDEmail = @.Email AND [State] = @.State AND [UserPassword] = @.UserPassword"49 ProviderName="<%$ ConnectionStrings:classydbConnectionString.ProviderName %>"50 SelectCommand="SELECT [AdNum], [Title], [Category], [Description], [Price], [Phone],Email, [State], [UserPassword] FROM [Ads] WHERE ([AdNum] = @.AdNum)"51 UpdateCommand="UPDATE [Ads] SET [Title] = @.Title, [Category] = @.Category, [Description] = @.Description, [Price] = @.Price, [Phone] = @.Phone,Email = @.Email, [State] = @.State, [UserPassword] = @.UserPassword WHERE [AdNum] = @.AdNum AND [Title] = @.Title AND [Category] = @.Category AND [Description] = @.Description AND [Price] = @.Price AND [Phone] = @.Phone ANDEmail = @.Email AND [State] = @.State AND [UserPassword] = @.UserPassword">5253 <SelectParameters>54 <asp:QueryStringParameter Name="AdNum" QueryStringField="AdNum" Type="Int32" />55 </SelectParameters>56 <DeleteParameters>57 <asp:Parameter Name="original_AdNum" Type="Int32" />58 <asp:Parameter Name="original_Title" Type="String" />59 <asp:Parameter Name="original_Category" Type="String" />60 <asp:Parameter Name="original_Description" Type="String" />61 <asp:Parameter Name="original_Price" Type="Decimal" />62 <asp:Parameter Name="original_Phone" Type="String" />63 <asp:Parameter Name="original_Email" Type="String" />64 <asp:Parameter Name="original_State" Type="String" />65 <asp:Parameter Name="original_UserPassword" Type="String" />66 </DeleteParameters>67 <UpdateParameters>68 <asp:Parameter Name="Title" Type="String" />69 <asp:Parameter Name="Category" Type="String" />70 <asp:Parameter Name="Description" Type="String" />71 <asp:Parameter Name="Price" Type="Decimal" />72 <asp:Parameter Name="Phone" Type="String" />73 <asp:Parameter Name="Email" Type="String" />74 <asp:Parameter Name="State" Type="String" />75 <asp:Parameter Name="UserPassword" Type="String" />76 <asp:Parameter Name="original_AdNum" Type="Int32" />77 <asp:Parameter Name="original_Title" Type="String" />78 <asp:Parameter Name="original_Category" Type="String" />79 <asp:Parameter Name="original_Description" Type="String" />80 <asp:Parameter Name="original_Price" Type="Decimal" />81 <asp:Parameter Name="original_Phone" Type="String" />82 <asp:Parameter Name="original_Email" Type="String" />83 <asp:Parameter Name="original_State" Type="String" />84 <asp:Parameter Name="original_UserPassword" Type="String" />85 </UpdateParameters>8687 </asp:SqlDataSource>8889</asp:content>

I appricate your help

Thanks Matthew

|||

Hi,

You can get information through these links:

http://www.asp.net/learn/dataaccess/tutorial50vb.aspx?tabid=63

http://forums.asp.net/thread/1172520.aspx

Wednesday, March 7, 2012

Including MSDE in Windows package, containing C# app

Hi,
I am trying to create a windows installer package, that will install:
- .NET framework
- MSDE
- My app..
Can anyone offer some advice, or point me in the right direction.
How would the package know if .NET framework is already installed, or if
MSDE is already installed.
Any advice appreciated
Thanks
Paul,
There is a deployment tool kit for MSDE.
http://www.microsoft.com/sql/msde/te...ployreskit.asp
If you use windows installer included with visual studio. It will
automatically add
an install dependency for the .net framework for a c# program.
Karl
"Paul Aspinall" wrote:

> Hi,
> I am trying to create a windows installer package, that will install:
> - .NET framework
> - MSDE
> - My app..
> Can anyone offer some advice, or point me in the right direction.
> How would the package know if .NET framework is already installed, or if
> MSDE is already installed.
> Any advice appreciated
> Thanks
>
>

Include Tick ('') in varchar?

Hi guys,

Been working on an app that stores customer data. All has been well until an address contained the tick ' character, ie the address is John O'Grotes in Scotland. Now, all ticks are currently stripped from any input for obvious reasons, but if I wanted to add it, how do I do it, and do it safely?

Address3 Varchar(100) is where I want to put it.

Many thanks,

Millicent.

Hi,

If you want to store single inverted comma (tick) in the db you can double up them up in the insert statement (e.g. John O''Grotes), also have a look at SET QUOTED_IDENTIFIER ON/OFF too, this allows you to mix single and double inverted comma.

Ray|||

I have never heard them called "single inverted commas" Single quotes, yes, commas, not so much Smile

|||

I have also not heard the reference "single inverted comma". I would also advise against a consistent practice of setting QUOTED_IDENTIFIER OFF so that you can use double quotes as a string delimiter. We have a couple of applications that do this thoughout and and as a result there is no hope of ever being able to use indexed views.

|||

Thanks all.

Millie.

|||

Absolutely nothing wrong with quotation marks, just didn't think of it at the time, I thought I would include a reference just in case you thought I was making up the inverted commas thing ;-).

http://universitywriting.shu.ac.uk/punct/advice/d_double.htm

Ray

Include Tick ('') in varchar?

Hi guys,

Been working on an app that stores customer data. All has been well until an address contained the tick ' character, ie the address is John O'Grotes in Scotland. Now, all ticks are currently stripped from any input for obvious reasons, but if I wanted to add it, how do I do it, and do it safely?

Address3 Varchar(100) is where I want to put it.

Many thanks,

Millicent.

Hi,

If you want to store single inverted comma (tick) in the db you can double up them up in the insert statement (e.g. John O''Grotes), also have a look at SET QUOTED_IDENTIFIER ON/OFF too, this allows you to mix single and double inverted comma.

Ray|||

I have never heard them called "single inverted commas" Single quotes, yes, commas, not so much Smile

|||

I have also not heard the reference "single inverted comma". I would also advise against a consistent practice of setting QUOTED_IDENTIFIER OFF so that you can use double quotes as a string delimiter. We have a couple of applications that do this thoughout and and as a result there is no hope of ever being able to use indexed views.

|||

Thanks all.

Millie.

|||

Absolutely nothing wrong with quotation marks, just didn't think of it at the time, I thought I would include a reference just in case you thought I was making up the inverted commas thing ;-).

http://universitywriting.shu.ac.uk/punct/advice/d_double.htm

Ray

Include Tick ('') in varchar?

Hi guys,

Been working on an app that stores customer data. All has been well until an address contained the tick ' character, ie the address is John O'Grotes in Scotland. Now, all ticks are currently stripped from any input for obvious reasons, but if I wanted to add it, how do I do it, and do it safely?

Address3 Varchar(100) is where I want to put it.

Many thanks,

Millicent.

Hi,

If you want to store single inverted comma (tick) in the db you can double up them up in the insert statement (e.g. John O''Grotes), also have a look at SET QUOTED_IDENTIFIER ON/OFF too, this allows you to mix single and double inverted comma.

Ray|||

I have never heard them called "single inverted commas" Single quotes, yes, commas, not so much Smile

|||

I have also not heard the reference "single inverted comma". I would also advise against a consistent practice of setting QUOTED_IDENTIFIER OFF so that you can use double quotes as a string delimiter. We have a couple of applications that do this thoughout and and as a result there is no hope of ever being able to use indexed views.

|||

Thanks all.

Millie.

|||

Absolutely nothing wrong with quotation marks, just didn't think of it at the time, I thought I would include a reference just in case you thought I was making up the inverted commas thing ;-).

http://universitywriting.shu.ac.uk/punct/advice/d_double.htm

Ray

Include Tick ('') in varchar?

Hi guys,

Been working on an app that stores customer data. All has been well until an address contained the tick ' character, ie the address is John O'Grotes in Scotland. Now, all ticks are currently stripped from any input for obvious reasons, but if I wanted to add it, how do I do it, and do it safely?

Address3 Varchar(100) is where I want to put it.

Many thanks,

Millicent.

Hi,

If you want to store single inverted comma (tick) in the db you can double up them up in the insert statement (e.g. John O''Grotes), also have a look at SET QUOTED_IDENTIFIER ON/OFF too, this allows you to mix single and double inverted comma.

Ray|||

I have never heard them called "single inverted commas" Single quotes, yes, commas, not so much Smile

|||

I have also not heard the reference "single inverted comma". I would also advise against a consistent practice of setting QUOTED_IDENTIFIER OFF so that you can use double quotes as a string delimiter. We have a couple of applications that do this thoughout and and as a result there is no hope of ever being able to use indexed views.

|||

Thanks all.

Millie.

|||

Absolutely nothing wrong with quotation marks, just didn't think of it at the time, I thought I would include a reference just in case you thought I was making up the inverted commas thing ;-).

http://universitywriting.shu.ac.uk/punct/advice/d_double.htm

Ray

Include Tick ('') in varchar?

Hi guys,

Been working on an app that stores customer data. All has been well until an address contained the tick ' character, ie the address is John O'Grotes in Scotland. Now, all ticks are currently stripped from any input for obvious reasons, but if I wanted to add it, how do I do it, and do it safely?

Address3 Varchar(100) is where I want to put it.

Many thanks,

Millicent.

Hi,

If you want to store single inverted comma (tick) in the db you can double up them up in the insert statement (e.g. John O''Grotes), also have a look at SET QUOTED_IDENTIFIER ON/OFF too, this allows you to mix single and double inverted comma.

Ray|||

I have never heard them called "single inverted commas" Single quotes, yes, commas, not so much Smile

|||

I have also not heard the reference "single inverted comma". I would also advise against a consistent practice of setting QUOTED_IDENTIFIER OFF so that you can use double quotes as a string delimiter. We have a couple of applications that do this thoughout and and as a result there is no hope of ever being able to use indexed views.

|||

Thanks all.

Millie.

|||

Absolutely nothing wrong with quotation marks, just didn't think of it at the time, I thought I would include a reference just in case you thought I was making up the inverted commas thing ;-).

http://universitywriting.shu.ac.uk/punct/advice/d_double.htm

Ray

Include Tick ('') in varchar?

Hi guys,

Been working on an app that stores customer data. All has been well until an address contained the tick ' character, ie the address is John O'Grotes in Scotland. Now, all ticks are currently stripped from any input for obvious reasons, but if I wanted to add it, how do I do it, and do it safely?

Address3 Varchar(100) is where I want to put it.

Many thanks,

Millicent.

Hi,

If you want to store single inverted comma (tick) in the db you can double up them up in the insert statement (e.g. John O''Grotes), also have a look at SET QUOTED_IDENTIFIER ON/OFF too, this allows you to mix single and double inverted comma.

Ray|||

I have never heard them called "single inverted commas" Single quotes, yes, commas, not so much Smile

|||

I have also not heard the reference "single inverted comma". I would also advise against a consistent practice of setting QUOTED_IDENTIFIER OFF so that you can use double quotes as a string delimiter. We have a couple of applications that do this thoughout and and as a result there is no hope of ever being able to use indexed views.

|||

Thanks all.

Millie.

|||

Absolutely nothing wrong with quotation marks, just didn't think of it at the time, I thought I would include a reference just in case you thought I was making up the inverted commas thing ;-).

http://universitywriting.shu.ac.uk/punct/advice/d_double.htm

Ray