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 |
cidr
Posting Yak Master
207 Posts |
Posted - 2010-10-20 : 04:32:01
|
Hi there,Hope everyones fineDoes anyone know if it's possible to create indexes by using a varible, for example:DECLARE @Index VARCHAR(8)SET @Index = 'Column'CREATE NONCLUSTERED INDEX [IX_EXAMPLE] ON dbo.tblExample( @Index ASC)WITH FILLFACTOR = 100 ON [PRIMARY] The code obviously doesn't work but just wanted to see if there's anyway of similar? Thanks for anyhelp in advance:) |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
cidr
Posting Yak Master
207 Posts |
Posted - 2010-10-20 : 05:18:06
|
Thanks Webfred! Forgot about dynamic sql |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-20 : 05:51:23
|
welcome No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
|
|
|