Solved

SQL 2000 memo field

Posted on 2003-11-12
11
951 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

760 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

21 Experts available now in Live!

Get 1:1 Help Now