?
Solved

SQL 2000 memo field

Posted on 2003-11-12
11
Medium Priority
?
967 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 750 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

764 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