Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
Maggy #1
Partial Index
Can someone tell if it's possible to partially index a
varchar. For instance, I have a varchar(40) field, but I
don't want to index all 40 characteres; I want to index
the first 15 characters. Is this possible? And if it is,
how might one write the SQL statement. I've tried using
the Substring function, but it has failed to work.
Thanks,
Maggy
Maggy Guest
-
partial index on boolean, problem with v8.0.0rc1
Hi all, PostgreSQL v8.0.0rc1, two variants of a "user_msg" table: create table user_msg ( message_id integer not null references message(id)... -
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Hey Folks,(New to .NET) This is driving me NUTZ... If anyone out there can resolve this from me I would greatly appreciate it... Line 238: Line... -
Newb query: index.htm & index.php & the server default
The problem I'm trying to solve is as follows: The website has two subdirectories: /ordinary and /phpstuff. Users typing hostname/ordinary get the... -
Partial Borders
I'm printing using an Epson 640 with an XP driver downloaded from the Epson site from Photoshop Elements 2.0. If I select a border in Print... -
Put partial text
Hi, Reading from the registry I get a string like "C:\Program Files\Abobe\Illustrator\illustrator.exe". set installtypeOverview=... -
Carlos Sacristan #2
Re: Partial Index
I thinks it is possible, but you have to change some things. Look this
example:
CREATE TABLE [dbo].[example] (
[a] [varchar] (40) COLLATE Traditional_Spanish_CI_AS NOT NULL ,
[b] AS (left([a],15))
) ON [PRIMARY]
GO
set
ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL ,ARITHABORT,QUOTED_IDENTIF
IER,ANSI_NULLS on
GO
set NUMERIC_ROUNDABORT off
GO
CREATE INDEX [IX_example] ON [dbo].[example]([b]) ON [PRIMARY]
GO
set arithabort OFF
GO
set numeric_roundabort OFF
GO
set quoted_identifier OFF
GO
--
--
Un saludo
--
--
----------------------------------------------
"Sólo sé que no sé nada. " (Sócrates)
(Guía de netiquette del foro)
[url]http://www.helpdna.net/bosqlfaq00.htm[/url]
[url]http://perso.wanadoo.es/rubenvigon/foro[/url]
(FAQ's de SQL Server)
[url]http://support.microsoft.com/default.aspx?scid=/support/sql/70faq.asp[/url]
[url]http://www.helpdna.net/bosqlfaq.htm[/url]
"Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> escribió en el mensaje
news:enYUuaJQDHA.1584@TK2MSFTNGP11.phx.gbl...> It is not possible to do that at this time.
>
> --
>
> Andrew J. Kelly
> SQL Server MVP
>
>
> "Maggy" <rmagnus@solutran.com> wrote in message
> news:407601c34096$23da5890$a401280a@phx.gbl...>> > Can someone tell if it's possible to partially index a
> > varchar. For instance, I have a varchar(40) field, but I
> > don't want to index all 40 characteres; I want to index
> > the first 15 characters. Is this possible? And if it is,
> > how might one write the SQL statement. I've tried using
> > the Substring function, but it has failed to work.
> >
> > Thanks,
> >
> > Maggy
>
Carlos Sacristan Guest
-
Andrew J. Kelly #3
Re: Partial Index
Well yes, if you want to create a new column then you can index it. But you
can't use expressions in the index definition itself.
--
Andrew J. Kelly
SQL Server MVP
"Carlos Sacristan" <csacristanARROBAocasoPUNTOes> wrote in message
news:ONOhrjJQDHA.2256@TK2MSFTNGP11.phx.gbl...ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL ,ARITHABORT,QUOTED_IDENTIF>
> I thinks it is possible, but you have to change some things. Look this
> example:
>
> CREATE TABLE [dbo].[example] (
> [a] [varchar] (40) COLLATE Traditional_Spanish_CI_AS NOT NULL ,
> [b] AS (left([a],15))
> ) ON [PRIMARY]
> GO
>
> set
>> IER,ANSI_NULLS on
> GO
>
> set NUMERIC_ROUNDABORT off
> GO
>
> CREATE INDEX [IX_example] ON [dbo].[example]([b]) ON [PRIMARY]
> GO
>
> set arithabort OFF
> GO
>
> set numeric_roundabort OFF
> GO
>
> set quoted_identifier OFF
> GO
>
>
>
> --
> --
>
> Un saludo
>
> --
> --
> ----------------------------------------------
> "Sólo sé que no sé nada. " (Sócrates)
>
> (Guía de netiquette del foro)
> [url]http://www.helpdna.net/bosqlfaq00.htm[/url]
> [url]http://perso.wanadoo.es/rubenvigon/foro[/url]
>
> (FAQ's de SQL Server)
> [url]http://support.microsoft.com/default.aspx?scid=/support/sql/70faq.asp[/url]
> [url]http://www.helpdna.net/bosqlfaq.htm[/url]
>
> "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> escribió en el mensaje
> news:enYUuaJQDHA.1584@TK2MSFTNGP11.phx.gbl...>> > It is not possible to do that at this time.
> >
> > --
> >
> > Andrew J. Kelly
> > SQL Server MVP
> >
> >
> > "Maggy" <rmagnus@solutran.com> wrote in message
> > news:407601c34096$23da5890$a401280a@phx.gbl...> >> > > Can someone tell if it's possible to partially index a
> > > varchar. For instance, I have a varchar(40) field, but I
> > > don't want to index all 40 characteres; I want to index
> > > the first 15 characters. Is this possible? And if it is,
> > > how might one write the SQL statement. I've tried using
> > > the Substring function, but it has failed to work.
> > >
> > > Thanks,
> > >
> > > Maggy
> >
>
Andrew J. Kelly Guest
-
Carlos Sacristan #4
Re: Partial Index
That's because I said to Maggy 'you have to change some things' ;-)
--
--
Un saludo
--
--
----------------------------------------------
"Sólo sé que no sé nada. " (Sócrates)
(Guía de netiquette del foro)
[url]http://www.helpdna.net/bosqlfaq00.htm[/url]
[url]http://perso.wanadoo.es/rubenvigon/foro[/url]
(FAQ's de SQL Server)
[url]http://support.microsoft.com/default.aspx?scid=/support/sql/70faq.asp[/url]
[url]http://www.helpdna.net/bosqlfaq.htm[/url]
"Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> escribió en el mensaje
news:ug$v$wJQDHA.3192@TK2MSFTNGP10.phx.gbl...you> Well yes, if you want to create a new column then you can index it. Butthis> can't use expressions in the index definition itself.
>
> --
>
> Andrew J. Kelly
> SQL Server MVP
>
>
> "Carlos Sacristan" <csacristanARROBAocasoPUNTOes> wrote in message
> news:ONOhrjJQDHA.2256@TK2MSFTNGP11.phx.gbl...> >
> > I thinks it is possible, but you have to change some things. LookANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL ,ARITHABORT,QUOTED_IDENTIF>> > example:
> >
> > CREATE TABLE [dbo].[example] (
> > [a] [varchar] (40) COLLATE Traditional_Spanish_CI_AS NOT NULL ,
> > [b] AS (left([a],15))
> > ) ON [PRIMARY]
> > GO
> >
> > set
> >>> > IER,ANSI_NULLS on
> > GO
> >
> > set NUMERIC_ROUNDABORT off
> > GO
> >
> > CREATE INDEX [IX_example] ON [dbo].[example]([b]) ON [PRIMARY]
> > GO
> >
> > set arithabort OFF
> > GO
> >
> > set numeric_roundabort OFF
> > GO
> >
> > set quoted_identifier OFF
> > GO
> >
> >
> >
> > --
> > --
> >
> > Un saludo
> >
> > --
> > --
> > ----------------------------------------------
> > "Sólo sé que no sé nada. " (Sócrates)
> >
> > (Guía de netiquette del foro)
> > [url]http://www.helpdna.net/bosqlfaq00.htm[/url]
> > [url]http://perso.wanadoo.es/rubenvigon/foro[/url]
> >
> > (FAQ's de SQL Server)
> > [url]http://support.microsoft.com/default.aspx?scid=/support/sql/70faq.asp[/url]
> > [url]http://www.helpdna.net/bosqlfaq.htm[/url]
> >
> > "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> escribió en el mensaje
> > news:enYUuaJQDHA.1584@TK2MSFTNGP11.phx.gbl...> >> > > It is not possible to do that at this time.
> > >
> > > --
> > >
> > > Andrew J. Kelly
> > > SQL Server MVP
> > >
> > >
> > > "Maggy" <rmagnus@solutran.com> wrote in message
> > > news:407601c34096$23da5890$a401280a@phx.gbl...
> > > > Can someone tell if it's possible to partially index a
> > > > varchar. For instance, I have a varchar(40) field, but I
> > > > don't want to index all 40 characteres; I want to index
> > > > the first 15 characters. Is this possible? And if it is,
> > > > how might one write the SQL statement. I've tried using
> > > > the Substring function, but it has failed to work.
> > > >
> > > > Thanks,
> > > >
> > > > Maggy
> > >
> > >
> >
>
Carlos Sacristan Guest



Reply With Quote

