Solved

SQL 2000 memo field

Posted on 2003-11-12
11
954 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
  • 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
 
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculated columns 13 60
Alter table 4 22
T-SQL for SS2000 -- get characters until a digit 6 19
Error running stored procedure 11 8
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 …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

939 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now