December 12, 2008 at 11:16 am
I am looking at some old code that has the following line when creating a view.
CREATE VIEW %ViewName
AS
-- Sql to create view
GO
I believe this is a variable that is set by a sql script. Can someone explain what a % sign before a variable means? I understand that a variable prefixed with @ is a local var and those prefixed with @@ is a global var. But I really haven't used the prefix % before.
Thanks!
December 15, 2008 at 8:47 am
I've never seen this before. As far as I know % is just the wild card character in SQL Server. Are you sure this is SQL Server code?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 17, 2008 at 4:35 am
no, never seen that either. Just double checked the syntax for views and theres no mention of % (other than for use as a wildcard)
http://msdn.microsoft.com/en-us/library/ms187956.aspx
James Howard
December 18, 2008 at 8:03 am
Is this a text file script you are running? I've seen lots of instances (usually with application installers) where they have a template file, and they either write the variables during the installation and run the scripts, or load the scripts, replace in memory and execute them.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply