restrictions on table naming?

restrictions on table naming?

Post by Dr. Crowba » Sat, 29 Jun 2002 00:15:40



Hi.  Is there a restriction on using a variable for a table name?  Such as




 
 
 

restrictions on table naming?

Post by Aaron Bertrand [MVP » Sat, 29 Jun 2002 00:35:04


Quote:> Hi.  Is there a restriction on using a variable for a table name?

Yes.

Try


--
www.aspfaq.com / www.perfhound.com

 
 
 

restrictions on table naming?

Post by Anith Se » Sat, 29 Jun 2002 00:43:44


Also see,
http://www.algonet.se/~sommar/dynamic_sql.html

- Anith


> Hi.  Is there a restriction on using a variable for a table name?  Such as





 
 
 

restrictions on table naming?

Post by Cory Stei » Sat, 29 Jun 2002 01:10:15


Try this.  I should work for you.






Cory Stein, MCP, MCDBA, MCSE

Quote:>-----Original Message-----
>Hi.  Is there a restriction on using a variable for a

table name?  Such as




>.

 
 
 

restrictions on table naming?

Post by Aaron Bertrand [MVP » Sat, 29 Jun 2002 01:27:30


Quote:> I should work for you.

:-)
 
 
 

restrictions on table naming?

Post by Steve Kas » Sat, 29 Jun 2002 01:32:19


And to make this or other dynamic SQL solutions safe from
malicious SQL injection, here's a solution.  If you will always
have a one-part table name (never dbo.tname or dbname..tname),
you can use QUOTENAME and forgo the quotename_ex()
function.

create function quotename_ex (

) returns nvarchar(512) as begin









end
go

create procedure [Select * from] (

) as



go

[Select * from] 'pubs..[authors]'
go

drop function quotename_ex
drop procedure [Select * from]

Steve Kass
Drew University


> Try this.  I should work for you.






> Cory Stein, MCP, MCDBA, MCSE

> >-----Original Message-----
> >Hi.  Is there a restriction on using a variable for a
> table name?  Such as




> >.

 
 
 

1. Object name length restriction

I've run into a problem with object name length restrictions in Access
97 while connecting to SQL Server. Objects in Access are restricted to
64 characters but SQL Server supports 128.

I have a table called 'zstblSecurityUserGroup' with a foreign key
constraint 'FK_zstblSecurityUserGroup_zstblSecurityGroup'. I put an
index on with the same same, neither name exceed 64 but when you try
to attach the table in Access it complains that it can't find the
table, I tracked the problem down to the fact that Access creates it's
virtual indices on linked tables as tablename_indexname so
'zstblSecurityUserGroup_FK_zstblSecurityUserGroup_zstblSecurityGroup'
does exceed the 64 characters. Access 2000 copes with this well but in
Access 97 can I get to a lower level to specify that Access not use
the table name as a prefix for the index name?

2. Free WinAPI file operations library updated

3. T-SQL Column Name Restrictions?

4. SAP R/3 & ABAP Systems - what are they?

5. Server Name Restrictions?

6. DAO Error

7. 8 character catalog name restriction

8. Embedded dynamic SQL

9. T-SQL Column Name Restrictions?

10. Field Name Restrictions(VB6.0/DAO/MSJET 3.51)

11. User Name length restriction

12. Oracle Names restriction?