Solved

SQL 2000 memo field

Posted on 2003-11-12
11
965 Views
Last Modified: 2008-02-01
What is the best type of SQL 2000 field to store an ACCESS memo field.

I keep reading that text(16) is the way to go, but you can not use a text varible in a stored proc.  

i.e.

CREATE PROCEDURE usp_someProc
(
      @Name varchar(50),
      @Description text(16),
      @CompanyID int
)
AS

What is the best pratice for a memo field?
0
Comment
Question by:makman111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9734777
varchar can hold upto 8000 chars. If you use text fields then you will need to use readtext function to read the text within sp.
0
 

Author Comment

by:makman111
ID: 9734802
not sure I am following your logic.  Do you have and example?
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9734875
This is an example from help file.

USE pubs
GO
DECLARE @ptrval varbinary(16)
SELECT @ptrval = TEXTPTR(pr_info)
   FROM pub_info pr INNER JOIN publishers p
      ON pr.pub_id = p.pub_id
      AND p.pub_name = 'New Moon Books'
READTEXT pub_info.pr_info @ptrval 1 25
GO


You will find many more examples if you search google
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 250 total points
ID: 9734903
The syntax is as follows:
CREATE PROCEDURE usp_someProc
(
     @Name varchar(50),
     @Description text,
     @CompanyID int
)
AS

Suggest you post the body of your stored procedure to see if a text column is the best solution.  The big question you need to ask:  Is there any chance the column will require more than 8000 bytes.

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9734918
Also, please maintain your many old open questions:

1 09/09/2003 500 Crystal Reports 9 and VB  Open DB Reporting Tools
2 09/09/2003 500 CR 9 exporting with VB  Open Crystal Reports
3 09/23/2003 500 DATEADD  Open JavaScript
4 09/26/2003 500 Creating a better scroll bar  Open Macromedia Flash
5 08/05/2003 500 (500 pts) Cycling and updating records  Open Microsoft SQL Server
6 08/06/2003 500 (500 pts.) Returning Stored Proc Values ...  Open Microsoft SQL Server

Thanks,
Anthony
0
 

Author Comment

by:makman111
ID: 9734991
I ended up answering my own question

Set objCmd = Server.CreateObject("ADODB.Command")
            objCmd.ActiveConnection = objDB
      
            objCmd.CommandText = "usp_Edit_RequirementDetails"
            objCmd.CommandType = adCmdStoredProc
            objCmd.Parameters.Refresh
      
            objCmd.Parameters("@RequirementDescription").Value = sRequirementDescription
            objCmd.Parameters("@RequirementName").Value = sRequirementName
            objCmd.Parameters("@RequirementID").value = iRequirementID
            objCmd.Parameters("@CompanyID").value = Session("CompanyID")
      
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9735164
>>objCmd.Parameters.Refresh<<
This should only be used when in development as it requires an extra roundtrip to the server.

Anthony
0
 

Author Comment

by:makman111
ID: 9735187
I posted that by mistake...

But I disagree with you.  the .refresh allows you to call a parameter by its keyword and not just it's position.  
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9735213
>>the .refresh allows you to call a parameter by its keyword and not just it's position.<<
It does, but there is a performance hit for that convenience, that most shops would not tolerate.

Anthony
0
 

Author Comment

by:makman111
ID: 9735234
true...

programer convience over preformance - "the microsoft way = just add more memory"

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9735237
This article lists some of the perils of the Parameters Refresh method:
HOWTO: Refresh ADO Parameters Collection for a Stored Procedure
http://support.microsoft.com/default.aspx?scid=kb;EN-US;174223

Anthony
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question