Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
declare
@tabName char(30),
@selectClause varchar(255)
SELECT @tabName="CreditUser"
SELECT @selectClause = "SELECT * FROM " + @tabName + " "
exec( @selectClause )
[code][COLOR=black]
Some things you should know.
[OL]
[LI]variables of type varchar(x) can be larger than 255 if you are using larger page sizes. (The 'norm' is 255 though)
[LI]a command executed inside 'EXEC' can be longer then 255 chars.
[LI]Break your sql statement up into "selectClause, FromClause, WhereClause etc etc" if you need to create large statements over 255 chars.
[/OL]
Ex:
[COLOR=purple][code]declare
@tabName char(30),
@selectClause varchar(255),
@fromClause varchar(255),
@whereClause varchar(255)
SELECT @tabName="CreditUser"
SELECT @selectClause = "SELECT * "
SELECT @fromClause = "FROM " + @tabName + " "
SELECT @whereClause = "WHERE blah = blah"
exec( @selectClause + @fromClause + @whereClause )
[code][COLOR=black]
Hope this helps.
-=-=-=-=-=-=-=-=-
For ease of reading, any posted CODE should be wrapped by [ignore][COLOR][/COLOR] and [CODE]
SELECT 1 from sysobjects
SELECT 1 from sysobjects
SELECT 1 from sysobjects
SELECT 1 from sysobjects
SELECT 1 from sysobjects