create index Query throug ado.net
- From: "Dil" <dilishtv@xxxxxxxxx>
- Date: 11 Jan 2006 02:09:17 -0800
hi all
Here am using "Use Database" keyword, as the connection string will
contain a different Initial Catalog
Pls let me know is there any Technical issues to execute this query
(Its working fine-)
Public Function GenerateCreateIndexQuery(ByVal TableName As String, _
ByVal IndexName As String, ByVal ColName As
String, _
ByVal dataBaseName As String)
Dim sqlStr As String
sqlStr = "USE " & dataBaseName & " IF EXISTS (SELECT name FROM
sysindexes WHERE name = '" & IndexName & "')"
sqlStr = sqlStr & " DROP INDEX " & TableName & "." & IndexName
sqlStr = sqlStr & " USE " & dataBaseName & " CREATE INDEX " &
IndexName & " ON "
sqlStr = sqlStr & TableName & "(" & ColName & ")"
Return sqlStr
End Function
.
- Follow-Ups:
- Re: create index Query throug ado.net
- From: Dil
- Re: create index Query throug ado.net
- Prev by Date: HttpWebRequest and ThreadPool running out of threads
- Next by Date: Re: long and bitwise & operator
- Previous by thread: HttpWebRequest and ThreadPool running out of threads
- Next by thread: Re: create index Query throug ado.net
- Index(es):
Relevant Pages
|
|