Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL 2000 memo field

Posted on 2003-11-12
11
Medium Priority
?
969 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

618 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