Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
joelseverich
Starting Member
34 Posts |
Posted - 2010-02-20 : 11:42:11
|
| Hi.I'm trying to do this:procedure Lock(Table) begin SELECT * FROM Table (TABLOCKX) endbut it doesn't work, can anyone help me?? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-20 : 11:43:41
|
| is lock(table) name of proc? then put it with []------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-20 : 11:45:55
|
quote: Originally posted by joelseverich Hi.I'm trying to do this:procedure Lock(Table) begin SELECT * FROM Table (TABLOCKX) endbut it doesn't work, can anyone help me??
Is the full code you are using?MadhivananFailing to plan is Planning to fail |
 |
|
|
joelseverich
Starting Member
34 Posts |
Posted - 2010-02-20 : 11:48:10
|
| the problem is that i cannot use the table name as a variable |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-20 : 11:50:09
|
quote: Originally posted by joelseverich the problem is that i cannot use the table name as a variable
for that you need to use dynamic sql------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-20 : 11:58:09
|
quote: Originally posted by joelseverich the problem is that i cannot use the table name as a variable
Why do you want to do this?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|