|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Variable use for table name
Hi,
I was wondering, is it possible to use a variable for a table name in a store proc query ? EX: SELECT * FROM clients Can I use a variable name instead of clients ? Thanks !! |
|
#2
|
|||
|
|||
|
Yes, you can but why? To me this indicates that you have multiple tables with the same definition which indicates a bad data model.
|
|
#3
|
|||
|
|||
|
Yes,
I do have multiple tables with the same definitions. I want to create a store proc that will be using multiple table names as parameter to get stats. Could you give me an example of using a variable name instead of a table name in a select statement? |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Variable use for table name |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|