Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to declare 2 dim varchar array, lock table

Posted on 2002-07-08
1
Medium Priority
?
1,112 Views
Last Modified: 2008-02-26
i use sql server 7.
1) how to declare varchar array of 2 dimension and how to use it?
2) How to lock a table [i want to lock when a critical procedure is being executed. i want the table to be locked till proc is executed]
0
Comment
Question by:sanjaykattimani
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 7139838
1) you cannot declare arrays in SQL Server, for data storage I would create a table with 2 address columns.

2) use transactions and locking hints:
CREATE yourproc
AS
BEGIN TRANSACTION
SELECT * FROM YOURTABLE (HOLDLOCK, UPDLOCK) <WHERE somecondition>
...


COMMIT TRANSACTION
GO

CHeers
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

926 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