Create Index - Andrea Pls Help



hi Andrea

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

.



Relevant Pages

  • create index Query throug ado.net
    ... 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 ... Public Function GenerateCreateIndexQuery(ByVal TableName As String, ...
    (microsoft.public.dotnet.general)
  • Create Index - Pls Help
    ... 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 ... Public Function GenerateCreateIndexQuery(ByVal TableName As String, ...
    (microsoft.public.data.ado)
  • Re: Data Shaping in VB6
    ... Public Function GetShapeConnection ... ' return a connection string to open a shaped recordset ... It works fine with a SQL Server ... or with an Access database under XP or NT. ...
    (microsoft.public.data.ado)
  • Re: Database permission
    ... cannot know where they will land at the end:) ... Even better, define the connection string in the config file, in this way ... >>> web application its telling me that it Failed for user Mike when ... >> catalog / sqlserver and give it permissions. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ADO compatibility between Excel XP and 2003
    ... to execute: ... Dim con As ADODB.Connection ... the connection string of the ADO connection is defined alright ...
    (microsoft.public.excel.programming)