I am running a script against a couple of databases on my SQL Server 2000 Standard Edition Instance and I am getting the following in the results pane:
"Default bound to column" I have searched the MS Knowledge base and found a couple of vague references to this. Does anyone know why I might be getting this? the script 'seems' to run fine.. except for the funky error in the results pane. Script is attached. Thank you!!maybe no one has answered because zip files make people nervous (viruses). Just post the code using the tags. I know I am not opening your zip file.|||IIRC the sp_bindefault will give that message; just run one of them to confirm that.
ALSO never zip up a SQL script as a DOC file and think you are going to get an answer.
Change it to a text file and then only if it is very large zip it up.
doc files are the most common file used to tranmit virii to other people followed by zip files so very few people word open your file.
I have both zip & doc files set to open with non-MS software so I should be safe but I almost did not open the doc.
Tim S
Showing posts with label couple. Show all posts
Showing posts with label couple. Show all posts
Monday, February 13, 2012
Friday, January 27, 2012
'-' in database name
Hi All,
We have a couple development database that contain a dash in them, something
like 'DB-TEST'.
I need to truncate the log and I would like to issue the following command:
backup log 'DB-TEST' with truncate_only
but sql-server doesn't like it
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
database names.
This fails both interactively and in a job.
Any help in escaping the - would be greatly appreciated.
TIA,
TimThere are rules for naming of things (aka 'identifiers') if you want to be
able to just type the name as it (without quoting the name in any way). This
is called 'standard identifiers'. By using a hyphen (dash, minus) you do not
follow those rules anymore. I discourage naming objects in this way.
The BACKUP command expects an identifier for the database name, and if you
don't follow the rules for standard identifiers, you have to quote the
database name, You can either use double-quotes or square brackets (non-ANSI
SQL). But not single quotes.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Tim" <tfleury@.pacbell.net> wrote in message
news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> We have a couple development database that contain a dash in them,
something
> like 'DB-TEST'.
> I need to truncate the log and I would like to issue the following
command:
> backup log 'DB-TEST' with truncate_only
> but sql-server doesn't like it
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
> database names.
> This fails both interactively and in a job.
> Any help in escaping the - would be greatly appreciated.
> TIA,
> Tim
>|||I inherited these database and I have tried to get them renamed but I have
encountered too much resistance.
But, I tried the [ ] brackets and they work like a champ.
Thanks a lot for the help.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:usYV8HO7DHA.2712@.tk2msftngp13.phx.gbl...
> There are rules for naming of things (aka 'identifiers') if you want to be
> able to just type the name as it (without quoting the name in any way).
This
> is called 'standard identifiers'. By using a hyphen (dash, minus) you do
not
> follow those rules anymore. I discourage naming objects in this way.
> The BACKUP command expects an identifier for the database name, and if you
> don't follow the rules for standard identifiers, you have to quote the
> database name, You can either use double-quotes or square brackets
(non-ANSI
> SQL). But not single quotes.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Tim" <tfleury@.pacbell.net> wrote in message
> news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> something
> command:
>
We have a couple development database that contain a dash in them, something
like 'DB-TEST'.
I need to truncate the log and I would like to issue the following command:
backup log 'DB-TEST' with truncate_only
but sql-server doesn't like it
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
database names.
This fails both interactively and in a job.
Any help in escaping the - would be greatly appreciated.
TIA,
TimThere are rules for naming of things (aka 'identifiers') if you want to be
able to just type the name as it (without quoting the name in any way). This
is called 'standard identifiers'. By using a hyphen (dash, minus) you do not
follow those rules anymore. I discourage naming objects in this way.
The BACKUP command expects an identifier for the database name, and if you
don't follow the rules for standard identifiers, you have to quote the
database name, You can either use double-quotes or square brackets (non-ANSI
SQL). But not single quotes.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Tim" <tfleury@.pacbell.net> wrote in message
news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> We have a couple development database that contain a dash in them,
something
> like 'DB-TEST'.
> I need to truncate the log and I would like to issue the following
command:
> backup log 'DB-TEST' with truncate_only
> but sql-server doesn't like it
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
> database names.
> This fails both interactively and in a job.
> Any help in escaping the - would be greatly appreciated.
> TIA,
> Tim
>|||I inherited these database and I have tried to get them renamed but I have
encountered too much resistance.
But, I tried the [ ] brackets and they work like a champ.
Thanks a lot for the help.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:usYV8HO7DHA.2712@.tk2msftngp13.phx.gbl...
> There are rules for naming of things (aka 'identifiers') if you want to be
> able to just type the name as it (without quoting the name in any way).
This
> is called 'standard identifiers'. By using a hyphen (dash, minus) you do
not
> follow those rules anymore. I discourage naming objects in this way.
> The BACKUP command expects an identifier for the database name, and if you
> don't follow the rules for standard identifiers, you have to quote the
> database name, You can either use double-quotes or square brackets
(non-ANSI
> SQL). But not single quotes.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Tim" <tfleury@.pacbell.net> wrote in message
> news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> something
> command:
>
'-' in database name
Hi All,
We have a couple development database that contain a dash in them, something
like 'DB-TEST'.
I need to truncate the log and I would like to issue the following command:
backup log 'DB-TEST' with truncate_only
but sql-server doesn't like it
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
database names.
This fails both interactively and in a job.
Any help in escaping the - would be greatly appreciated.
TIA,
TimThere are rules for naming of things (aka 'identifiers') if you want to be
able to just type the name as it (without quoting the name in any way). This
is called 'standard identifiers'. By using a hyphen (dash, minus) you do not
follow those rules anymore. I discourage naming objects in this way.
The BACKUP command expects an identifier for the database name, and if you
don't follow the rules for standard identifiers, you have to quote the
database name, You can either use double-quotes or square brackets (non-ANSI
SQL). But not single quotes.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Tim" <tfleury@.pacbell.net> wrote in message
news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> We have a couple development database that contain a dash in them,
something
> like 'DB-TEST'.
> I need to truncate the log and I would like to issue the following
command:
> backup log 'DB-TEST' with truncate_only
> but sql-server doesn't like it
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
> database names.
> This fails both interactively and in a job.
> Any help in escaping the - would be greatly appreciated.
> TIA,
> Tim
>|||I inherited these database and I have tried to get them renamed but I have
encountered too much resistance.
But, I tried the [ ] brackets and they work like a champ.
Thanks a lot for the help.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:usYV8HO7DHA.2712@.tk2msftngp13.phx.gbl...
> There are rules for naming of things (aka 'identifiers') if you want to be
> able to just type the name as it (without quoting the name in any way).
This
> is called 'standard identifiers'. By using a hyphen (dash, minus) you do
not
> follow those rules anymore. I discourage naming objects in this way.
> The BACKUP command expects an identifier for the database name, and if you
> don't follow the rules for standard identifiers, you have to quote the
> database name, You can either use double-quotes or square brackets
(non-ANSI
> SQL). But not single quotes.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Tim" <tfleury@.pacbell.net> wrote in message
> news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> > Hi All,
> >
> > We have a couple development database that contain a dash in them,
> something
> > like 'DB-TEST'.
> >
> > I need to truncate the log and I would like to issue the following
> command:
> >
> > backup log 'DB-TEST' with truncate_only
> >
> > but sql-server doesn't like it
> >
> > Server: Msg 170, Level 15, State 1, Line 1
> > Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
> > database names.
> >
> > This fails both interactively and in a job.
> >
> > Any help in escaping the - would be greatly appreciated.
> >
> > TIA,
> > Tim
> >
> >
>
We have a couple development database that contain a dash in them, something
like 'DB-TEST'.
I need to truncate the log and I would like to issue the following command:
backup log 'DB-TEST' with truncate_only
but sql-server doesn't like it
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
database names.
This fails both interactively and in a job.
Any help in escaping the - would be greatly appreciated.
TIA,
TimThere are rules for naming of things (aka 'identifiers') if you want to be
able to just type the name as it (without quoting the name in any way). This
is called 'standard identifiers'. By using a hyphen (dash, minus) you do not
follow those rules anymore. I discourage naming objects in this way.
The BACKUP command expects an identifier for the database name, and if you
don't follow the rules for standard identifiers, you have to quote the
database name, You can either use double-quotes or square brackets (non-ANSI
SQL). But not single quotes.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Tim" <tfleury@.pacbell.net> wrote in message
news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> We have a couple development database that contain a dash in them,
something
> like 'DB-TEST'.
> I need to truncate the log and I would like to issue the following
command:
> backup log 'DB-TEST' with truncate_only
> but sql-server doesn't like it
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
> database names.
> This fails both interactively and in a job.
> Any help in escaping the - would be greatly appreciated.
> TIA,
> Tim
>|||I inherited these database and I have tried to get them renamed but I have
encountered too much resistance.
But, I tried the [ ] brackets and they work like a champ.
Thanks a lot for the help.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:usYV8HO7DHA.2712@.tk2msftngp13.phx.gbl...
> There are rules for naming of things (aka 'identifiers') if you want to be
> able to just type the name as it (without quoting the name in any way).
This
> is called 'standard identifiers'. By using a hyphen (dash, minus) you do
not
> follow those rules anymore. I discourage naming objects in this way.
> The BACKUP command expects an identifier for the database name, and if you
> don't follow the rules for standard identifiers, you have to quote the
> database name, You can either use double-quotes or square brackets
(non-ANSI
> SQL). But not single quotes.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Tim" <tfleury@.pacbell.net> wrote in message
> news:uYqAeBO7DHA.2472@.TK2MSFTNGP10.phx.gbl...
> > Hi All,
> >
> > We have a couple development database that contain a dash in them,
> something
> > like 'DB-TEST'.
> >
> > I need to truncate the log and I would like to issue the following
> command:
> >
> > backup log 'DB-TEST' with truncate_only
> >
> > but sql-server doesn't like it
> >
> > Server: Msg 170, Level 15, State 1, Line 1
> > Line 1: Incorrect syntax near 'DB-TEST'. ****works fine for one word
> > database names.
> >
> > This fails both interactively and in a job.
> >
> > Any help in escaping the - would be greatly appreciated.
> >
> > TIA,
> > Tim
> >
> >
>
Subscribe to:
Posts (Atom)
