Hi,
When running reports on a SQL 2000 Server database they are printing with $
signs instead of signs. printing from other apps like notepad on the
server or client ptints fine (i.e. with signs).
If I run SELECT @.@.LANGUAGE on the sql server it shows as us_english. The
same if I look at the general tab of the server in enterprise manager.
Could someone tell me how to change the default language to uk?
SQL Server 2000
on Windows 2000 Server
Thanks,
SteveSteve,
you can use :
sp_configure 'default language', 23
reconfigure with override
This resets the default language. The default only seems to apply to new
logins however and will affect the way strings are interpreted as dates but
it doesn't reset the value returned by @.@.language. I have heard that to
change the @.@.language value you have to reinstall, as it is picked up from
the locale at the time of installation, but have never confirmed this.
Anyway, I suspect that the $ sign is being added due to the settings of your
reporting application rather than anything to do with SQL Server. As far as
I recall, if you're using reporting services, the page setting overrides the
system locale settings, which would explain it.
HTH,
Paul Ibison|||Thanks Paul,
Thats most helpful. We were suspecting the application too but wanted to
cover all our bases before going to the third party.
Thanks,
Steve
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OLattPIKEHA.2456@.TK2MSFTNGP12.phx.gbl...
> Steve,
> you can use :
> sp_configure 'default language', 23
> reconfigure with override
> This resets the default language. The default only seems to apply to new
> logins however and will affect the way strings are interpreted as dates
but
> it doesn't reset the value returned by @.@.language. I have heard that to
> change the @.@.language value you have to reinstall, as it is picked up from
> the locale at the time of installation, but have never confirmed this.
> Anyway, I suspect that the $ sign is being added due to the settings of
your
> reporting application rather than anything to do with SQL Server. As far
as
> I recall, if you're using reporting services, the page setting overrides
the
> system locale settings, which would explain it.
> HTH,
> Paul Ibison
>
Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts
Thursday, March 29, 2012
Default Language
Hi,
When running reports on a SQL 2000 Server database they are printing with $
signs instead of signs. printing from other apps like notepad on the
server or client ptints fine (i.e. with signs).
If I run SELECT @.@.LANGUAGE on the sql server it shows as us_english. The
same if I look at the general tab of the server in enterprise manager.
Could someone tell me how to change the default language to uk?
SQL Server 2000
on Windows 2000 Server
Thanks,
Steve
Steve,
you can use :
sp_configure 'default language', 23
reconfigure with override
This resets the default language. The default only seems to apply to new
logins however and will affect the way strings are interpreted as dates but
it doesn't reset the value returned by @.@.language. I have heard that to
change the @.@.language value you have to reinstall, as it is picked up from
the locale at the time of installation, but have never confirmed this.
Anyway, I suspect that the $ sign is being added due to the settings of your
reporting application rather than anything to do with SQL Server. As far as
I recall, if you're using reporting services, the page setting overrides the
system locale settings, which would explain it.
HTH,
Paul Ibison
|||Thanks Paul,
Thats most helpful. We were suspecting the application too but wanted to
cover all our bases before going to the third party.
Thanks,
Steve
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OLattPIKEHA.2456@.TK2MSFTNGP12.phx.gbl...
> Steve,
> you can use :
> sp_configure 'default language', 23
> reconfigure with override
> This resets the default language. The default only seems to apply to new
> logins however and will affect the way strings are interpreted as dates
but
> it doesn't reset the value returned by @.@.language. I have heard that to
> change the @.@.language value you have to reinstall, as it is picked up from
> the locale at the time of installation, but have never confirmed this.
> Anyway, I suspect that the $ sign is being added due to the settings of
your
> reporting application rather than anything to do with SQL Server. As far
as
> I recall, if you're using reporting services, the page setting overrides
the
> system locale settings, which would explain it.
> HTH,
> Paul Ibison
>
When running reports on a SQL 2000 Server database they are printing with $
signs instead of signs. printing from other apps like notepad on the
server or client ptints fine (i.e. with signs).
If I run SELECT @.@.LANGUAGE on the sql server it shows as us_english. The
same if I look at the general tab of the server in enterprise manager.
Could someone tell me how to change the default language to uk?
SQL Server 2000
on Windows 2000 Server
Thanks,
Steve
Steve,
you can use :
sp_configure 'default language', 23
reconfigure with override
This resets the default language. The default only seems to apply to new
logins however and will affect the way strings are interpreted as dates but
it doesn't reset the value returned by @.@.language. I have heard that to
change the @.@.language value you have to reinstall, as it is picked up from
the locale at the time of installation, but have never confirmed this.
Anyway, I suspect that the $ sign is being added due to the settings of your
reporting application rather than anything to do with SQL Server. As far as
I recall, if you're using reporting services, the page setting overrides the
system locale settings, which would explain it.
HTH,
Paul Ibison
|||Thanks Paul,
Thats most helpful. We were suspecting the application too but wanted to
cover all our bases before going to the third party.
Thanks,
Steve
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OLattPIKEHA.2456@.TK2MSFTNGP12.phx.gbl...
> Steve,
> you can use :
> sp_configure 'default language', 23
> reconfigure with override
> This resets the default language. The default only seems to apply to new
> logins however and will affect the way strings are interpreted as dates
but
> it doesn't reset the value returned by @.@.language. I have heard that to
> change the @.@.language value you have to reinstall, as it is picked up from
> the locale at the time of installation, but have never confirmed this.
> Anyway, I suspect that the $ sign is being added due to the settings of
your
> reporting application rather than anything to do with SQL Server. As far
as
> I recall, if you're using reporting services, the page setting overrides
the
> system locale settings, which would explain it.
> HTH,
> Paul Ibison
>
Default Language
Hi,
When running reports on a SQL 2000 Server database they are printing with $
signs instead of £ signs. printing from other apps like notepad on the
server or client ptints fine (i.e. with £ signs).
If I run SELECT @.@.LANGUAGE on the sql server it shows as us_english. The
same if I look at the general tab of the server in enterprise manager.
Could someone tell me how to change the default language to uk?
SQL Server 2000
on Windows 2000 Server
Thanks,
SteveSteve,
you can use :
sp_configure 'default language', 23
reconfigure with override
This resets the default language. The default only seems to apply to new
logins however and will affect the way strings are interpreted as dates but
it doesn't reset the value returned by @.@.language. I have heard that to
change the @.@.language value you have to reinstall, as it is picked up from
the locale at the time of installation, but have never confirmed this.
Anyway, I suspect that the $ sign is being added due to the settings of your
reporting application rather than anything to do with SQL Server. As far as
I recall, if you're using reporting services, the page setting overrides the
system locale settings, which would explain it.
HTH,
Paul Ibison|||Thanks Paul,
Thats most helpful. We were suspecting the application too but wanted to
cover all our bases before going to the third party.
Thanks,
Steve
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OLattPIKEHA.2456@.TK2MSFTNGP12.phx.gbl...
> Steve,
> you can use :
> sp_configure 'default language', 23
> reconfigure with override
> This resets the default language. The default only seems to apply to new
> logins however and will affect the way strings are interpreted as dates
but
> it doesn't reset the value returned by @.@.language. I have heard that to
> change the @.@.language value you have to reinstall, as it is picked up from
> the locale at the time of installation, but have never confirmed this.
> Anyway, I suspect that the $ sign is being added due to the settings of
your
> reporting application rather than anything to do with SQL Server. As far
as
> I recall, if you're using reporting services, the page setting overrides
the
> system locale settings, which would explain it.
> HTH,
> Paul Ibison
>
When running reports on a SQL 2000 Server database they are printing with $
signs instead of £ signs. printing from other apps like notepad on the
server or client ptints fine (i.e. with £ signs).
If I run SELECT @.@.LANGUAGE on the sql server it shows as us_english. The
same if I look at the general tab of the server in enterprise manager.
Could someone tell me how to change the default language to uk?
SQL Server 2000
on Windows 2000 Server
Thanks,
SteveSteve,
you can use :
sp_configure 'default language', 23
reconfigure with override
This resets the default language. The default only seems to apply to new
logins however and will affect the way strings are interpreted as dates but
it doesn't reset the value returned by @.@.language. I have heard that to
change the @.@.language value you have to reinstall, as it is picked up from
the locale at the time of installation, but have never confirmed this.
Anyway, I suspect that the $ sign is being added due to the settings of your
reporting application rather than anything to do with SQL Server. As far as
I recall, if you're using reporting services, the page setting overrides the
system locale settings, which would explain it.
HTH,
Paul Ibison|||Thanks Paul,
Thats most helpful. We were suspecting the application too but wanted to
cover all our bases before going to the third party.
Thanks,
Steve
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OLattPIKEHA.2456@.TK2MSFTNGP12.phx.gbl...
> Steve,
> you can use :
> sp_configure 'default language', 23
> reconfigure with override
> This resets the default language. The default only seems to apply to new
> logins however and will affect the way strings are interpreted as dates
but
> it doesn't reset the value returned by @.@.language. I have heard that to
> change the @.@.language value you have to reinstall, as it is picked up from
> the locale at the time of installation, but have never confirmed this.
> Anyway, I suspect that the $ sign is being added due to the settings of
your
> reporting application rather than anything to do with SQL Server. As far
as
> I recall, if you're using reporting services, the page setting overrides
the
> system locale settings, which would explain it.
> HTH,
> Paul Ibison
>
Tuesday, March 27, 2012
default dbo to object names instead of user name
Several developers have been assigned dbo of a database. Is there a way to
allow all the objects that we create to all have the dbo ownership by
default, rather than our user name?
I'm aware that we could explicitly type ...
create proc dbo.myprocedurename as
but was hoping this could be the default behavior.
Thanks in advance.
Mark
Mark,
I assume you mean they have been assigned the db_owner role? Only one login can be the dbo user. There is a
difference between dbo and db_owner.
Assuming that the logins have their own user names and are indeed db_owner, then you have to qualify the owner
when you create the object. Only way around is to use sp_addalias, but this will disappear in future and
there's no GUI support for this. Be careful to read in BOL whether it is supported or not.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mark" <mfield@.idonotlikespam.cce.umn.edu> wrote in message news:%23GgYl4dMEHA.1392@.TK2MSFTNGP09.phx.gbl...
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
> I'm aware that we could explicitly type ...
> create proc dbo.myprocedurename as
> but was hoping this could be the default behavior.
> Thanks in advance.
> Mark
>
|||Mark wrote:
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
could you put all those developers into a group on the db server and then have
that group be the dbowner of the db?
allow all the objects that we create to all have the dbo ownership by
default, rather than our user name?
I'm aware that we could explicitly type ...
create proc dbo.myprocedurename as
but was hoping this could be the default behavior.
Thanks in advance.
Mark
Mark,
I assume you mean they have been assigned the db_owner role? Only one login can be the dbo user. There is a
difference between dbo and db_owner.
Assuming that the logins have their own user names and are indeed db_owner, then you have to qualify the owner
when you create the object. Only way around is to use sp_addalias, but this will disappear in future and
there's no GUI support for this. Be careful to read in BOL whether it is supported or not.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mark" <mfield@.idonotlikespam.cce.umn.edu> wrote in message news:%23GgYl4dMEHA.1392@.TK2MSFTNGP09.phx.gbl...
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
> I'm aware that we could explicitly type ...
> create proc dbo.myprocedurename as
> but was hoping this could be the default behavior.
> Thanks in advance.
> Mark
>
|||Mark wrote:
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
could you put all those developers into a group on the db server and then have
that group be the dbowner of the db?
default dbo to object names instead of user name
Several developers have been assigned dbo of a database. Is there a way to
allow all the objects that we create to all have the dbo ownership by
default, rather than our user name?
I'm aware that we could explicitly type ...
create proc dbo.myprocedurename as
but was hoping this could be the default behavior.
Thanks in advance.
MarkMark,
I assume you mean they have been assigned the db_owner role? Only one login
can be the dbo user. There is a
difference between dbo and db_owner.
Assuming that the logins have their own user names and are indeed db_owner,
then you have to qualify the owner
when you create the object. Only way around is to use sp_addalias, but this
will disappear in future and
there's no GUI support for this. Be careful to read in BOL whether it is sup
ported or not.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mark" <mfield@.idonotlikespam.cce.umn.edu> wrote in message news:%23GgYl4dMEHA.1392@.TK2MSFTN
GP09.phx.gbl...
> Several developers have been assigned dbo of a database. Is there a way t
o
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
> I'm aware that we could explicitly type ...
> create proc dbo.myprocedurename as
> but was hoping this could be the default behavior.
> Thanks in advance.
> Mark
>|||Mark wrote:
> Several developers have been assigned dbo of a database. Is there a way t
o
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
could you put all those developers into a group on the db server and then ha
ve
that group be the dbowner of the db?sql
allow all the objects that we create to all have the dbo ownership by
default, rather than our user name?
I'm aware that we could explicitly type ...
create proc dbo.myprocedurename as
but was hoping this could be the default behavior.
Thanks in advance.
MarkMark,
I assume you mean they have been assigned the db_owner role? Only one login
can be the dbo user. There is a
difference between dbo and db_owner.
Assuming that the logins have their own user names and are indeed db_owner,
then you have to qualify the owner
when you create the object. Only way around is to use sp_addalias, but this
will disappear in future and
there's no GUI support for this. Be careful to read in BOL whether it is sup
ported or not.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mark" <mfield@.idonotlikespam.cce.umn.edu> wrote in message news:%23GgYl4dMEHA.1392@.TK2MSFTN
GP09.phx.gbl...
> Several developers have been assigned dbo of a database. Is there a way t
o
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
> I'm aware that we could explicitly type ...
> create proc dbo.myprocedurename as
> but was hoping this could be the default behavior.
> Thanks in advance.
> Mark
>|||Mark wrote:
> Several developers have been assigned dbo of a database. Is there a way t
o
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
could you put all those developers into a group on the db server and then ha
ve
that group be the dbowner of the db?sql
default dbo to object names instead of user name
Several developers have been assigned dbo of a database. Is there a way to
allow all the objects that we create to all have the dbo ownership by
default, rather than our user name?
I'm aware that we could explicitly type ...
create proc dbo.myprocedurename as
but was hoping this could be the default behavior.
Thanks in advance.
MarkMark,
I assume you mean they have been assigned the db_owner role? Only one login can be the dbo user. There is a
difference between dbo and db_owner.
Assuming that the logins have their own user names and are indeed db_owner, then you have to qualify the owner
when you create the object. Only way around is to use sp_addalias, but this will disappear in future and
there's no GUI support for this. Be careful to read in BOL whether it is supported or not.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mark" <mfield@.idonotlikespam.cce.umn.edu> wrote in message news:%23GgYl4dMEHA.1392@.TK2MSFTNGP09.phx.gbl...
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
> I'm aware that we could explicitly type ...
> create proc dbo.myprocedurename as
> but was hoping this could be the default behavior.
> Thanks in advance.
> Mark
>|||Mark wrote:
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
could you put all those developers into a group on the db server and then have
that group be the dbowner of the db?
allow all the objects that we create to all have the dbo ownership by
default, rather than our user name?
I'm aware that we could explicitly type ...
create proc dbo.myprocedurename as
but was hoping this could be the default behavior.
Thanks in advance.
MarkMark,
I assume you mean they have been assigned the db_owner role? Only one login can be the dbo user. There is a
difference between dbo and db_owner.
Assuming that the logins have their own user names and are indeed db_owner, then you have to qualify the owner
when you create the object. Only way around is to use sp_addalias, but this will disappear in future and
there's no GUI support for this. Be careful to read in BOL whether it is supported or not.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Mark" <mfield@.idonotlikespam.cce.umn.edu> wrote in message news:%23GgYl4dMEHA.1392@.TK2MSFTNGP09.phx.gbl...
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
> I'm aware that we could explicitly type ...
> create proc dbo.myprocedurename as
> but was hoping this could be the default behavior.
> Thanks in advance.
> Mark
>|||Mark wrote:
> Several developers have been assigned dbo of a database. Is there a way to
> allow all the objects that we create to all have the dbo ownership by
> default, rather than our user name?
could you put all those developers into a group on the db server and then have
that group be the dbowner of the db?
Sunday, March 25, 2012
Default database mapping is "Master" - why?
Gurus,
Running SQL Server 2005 SP2. I noticed when I explore my users SQL database
mappings, a lot of times their default database is "Master" instead of the
various application databases which exist on the server. Which is correct,
pointing at master or to their specific application database?
Spin
Both are correct. It's a matter of how you'd like to set the default database
of a login, and you can use sp_defaultdb to change it. The most likely reason
why they have different default databases is that the logins were not created
consistently. Some were created with an explicit default database, while the
other were created without an explicit default, in which case master would be
chosen as the default database for the login.
Linchi
"Spin" wrote:
> Gurus,
> Running SQL Server 2005 SP2. I noticed when I explore my users SQL database
> mappings, a lot of times their default database is "Master" instead of the
> various application databases which exist on the server. Which is correct,
> pointing at master or to their specific application database?
> --
> Spin
>
|||"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
> Both are correct. It's a matter of how you'd like to set the default
> database
> of a login, and you can use sp_defaultdb to change it. The most likely
> reason
> why they have different default databases is that the logins were not
> created
> consistently. Some were created with an explicit default database, while
> the
> other were created without an explicit default, in which case master would
> be
> chosen as the default database for the login.
But if users cannot login into "Master" than it would make sense for
performance reasons (faster login) to properly set the databse during
account setup correct?
Spin
|||Spin
I do not know your business requirements as well as how your application
does the work.
What if you set default database and that database git corrupted. Login
could bot connect to the server to see/repair the database?
"Spin" <Spin@.invalid.com> wrote in message
news:64bk62F2agtgvU1@.mid.individual.net...
> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
> But if users cannot login into "Master" than it would make sense for
> performance reasons (faster login) to properly set the databse during
> account setup correct?
> Spin
>
|||Tibor
If you try connect with a login who has corrupted/notexistence database (
was set as a deafult) then you cannot connect to the server, I think that is
what the OP meant .
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23BqVbWZiIHA.4140@.TK2MSFTNGP04.phx.gbl...
> You don't "login" to a database. You login to the instance and then "use"
> a database. Also, every login can use master since there is a guest user
> in the master database.
>
> Default database do no affect login time.
> In most cases the default database is irrelevant since your application
> will connect to the desired database thanks to the db name specified in
> the connection string.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Spin" <Spin@.invalid.com> wrote in message
> news:64bk62F2agtgvU1@.mid.individual.net...
>
|||Hi Tibor
> Correct, for some applications.
Such as QA :-))))
> I don't think so. I do not see any reference to a non-existing default
> database in below OP's post, to which my reply was for:
I re-read his post. You got it right.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGd0fRaiIHA.6032@.TK2MSFTNGP03.phx.gbl...
> Hi Uri,
>
> Correct, for some applications. Where other will fall back to some other
> database.
>
> I don't think so. I do not see any reference to a non-existing default
> database in below OP's post, to which my reply was for:
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OEmgtdZiIHA.4076@.TK2MSFTNGP05.phx.gbl...
>
Running SQL Server 2005 SP2. I noticed when I explore my users SQL database
mappings, a lot of times their default database is "Master" instead of the
various application databases which exist on the server. Which is correct,
pointing at master or to their specific application database?
Spin
Both are correct. It's a matter of how you'd like to set the default database
of a login, and you can use sp_defaultdb to change it. The most likely reason
why they have different default databases is that the logins were not created
consistently. Some were created with an explicit default database, while the
other were created without an explicit default, in which case master would be
chosen as the default database for the login.
Linchi
"Spin" wrote:
> Gurus,
> Running SQL Server 2005 SP2. I noticed when I explore my users SQL database
> mappings, a lot of times their default database is "Master" instead of the
> various application databases which exist on the server. Which is correct,
> pointing at master or to their specific application database?
> --
> Spin
>
|||"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
> Both are correct. It's a matter of how you'd like to set the default
> database
> of a login, and you can use sp_defaultdb to change it. The most likely
> reason
> why they have different default databases is that the logins were not
> created
> consistently. Some were created with an explicit default database, while
> the
> other were created without an explicit default, in which case master would
> be
> chosen as the default database for the login.
But if users cannot login into "Master" than it would make sense for
performance reasons (faster login) to properly set the databse during
account setup correct?
Spin
|||Spin
I do not know your business requirements as well as how your application
does the work.
What if you set default database and that database git corrupted. Login
could bot connect to the server to see/repair the database?
"Spin" <Spin@.invalid.com> wrote in message
news:64bk62F2agtgvU1@.mid.individual.net...
> "Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
> news:488CB1F7-21FE-400E-BC77-651BD60723FB@.microsoft.com...
> But if users cannot login into "Master" than it would make sense for
> performance reasons (faster login) to properly set the databse during
> account setup correct?
> Spin
>
|||Tibor
If you try connect with a login who has corrupted/notexistence database (
was set as a deafult) then you cannot connect to the server, I think that is
what the OP meant .
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23BqVbWZiIHA.4140@.TK2MSFTNGP04.phx.gbl...
> You don't "login" to a database. You login to the instance and then "use"
> a database. Also, every login can use master since there is a guest user
> in the master database.
>
> Default database do no affect login time.
> In most cases the default database is irrelevant since your application
> will connect to the desired database thanks to the db name specified in
> the connection string.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Spin" <Spin@.invalid.com> wrote in message
> news:64bk62F2agtgvU1@.mid.individual.net...
>
|||Hi Tibor
> Correct, for some applications.
Such as QA :-))))
> I don't think so. I do not see any reference to a non-existing default
> database in below OP's post, to which my reply was for:
I re-read his post. You got it right.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGd0fRaiIHA.6032@.TK2MSFTNGP03.phx.gbl...
> Hi Uri,
>
> Correct, for some applications. Where other will fall back to some other
> database.
>
> I don't think so. I do not see any reference to a non-existing default
> database in below OP's post, to which my reply was for:
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OEmgtdZiIHA.4076@.TK2MSFTNGP05.phx.gbl...
>
Wednesday, March 7, 2012
Decimal places for integer divisions
SELECT 1/2 returns 0 in transact sql instead of 0.500000
How do I get it to return 0.5000 ?You need to force SQL Server to not do integer division. Try:
SELECT CAST(1 AS float) / CAST(2 AS float)|||You really have to understand datatypes. I still regularly get questions that resemble this one from developers who've been using SQL for years.
In integer division, one divided by two equals zero with a remainder of one. When you divide one integer by another, integer math is used. If you cast either the dividend or the divisor to a real, then real math will be used (with implicit promotion if needed).
-PatP|||Originally posted by calicocat
You need to force SQL Server to not do integer division. Try:
SELECT CAST(1 AS float) / CAST(2 AS float)
Nah...it'll infer type if you let it...
SELECT 1/2.0|||A little more on my problem.
I have two columns in a table each storing integer values. I would like the division to return a decimal number
eg. select col1/col2 should return a decimal result... Neither of the above solutions work.|||OK, so now you need to convert
USE Northwind
GO
CREATE TABLE myTable99(Col1 int, Col2 int)
GO
INSERT INTO myTable99(Col1,Col2)
SELECT 1,2
GO
SELECT Col1/CONVERT(decimal(8,4),Col2)
FROM myTable99
GO
DROP TABLE myTable99
GO
How do I get it to return 0.5000 ?You need to force SQL Server to not do integer division. Try:
SELECT CAST(1 AS float) / CAST(2 AS float)|||You really have to understand datatypes. I still regularly get questions that resemble this one from developers who've been using SQL for years.
In integer division, one divided by two equals zero with a remainder of one. When you divide one integer by another, integer math is used. If you cast either the dividend or the divisor to a real, then real math will be used (with implicit promotion if needed).
-PatP|||Originally posted by calicocat
You need to force SQL Server to not do integer division. Try:
SELECT CAST(1 AS float) / CAST(2 AS float)
Nah...it'll infer type if you let it...
SELECT 1/2.0|||A little more on my problem.
I have two columns in a table each storing integer values. I would like the division to return a decimal number
eg. select col1/col2 should return a decimal result... Neither of the above solutions work.|||OK, so now you need to convert
USE Northwind
GO
CREATE TABLE myTable99(Col1 int, Col2 int)
GO
INSERT INTO myTable99(Col1,Col2)
SELECT 1,2
GO
SELECT Col1/CONVERT(decimal(8,4),Col2)
FROM myTable99
GO
DROP TABLE myTable99
GO
Saturday, February 25, 2012
Debugging triggers on views in SQL Server 2005?
I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Server
2005. I setup a stored procedure to insert to the view, then (in Visual
Studio) put a stop in the stored procedure. This works fine, until I try to
step into the trigger. Then it tells me that no code is available.
If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won't
allow me, saying "A breakpoint could not be inserted at this location".
This only happens for any trigger on the view. If I try to set a breakpoint
on a trigger on a table, it works fine.
Does anyone know a way around this? I really would like to step though the
trigger on the view.Is anyone going to respond to this? I thought these news groups were managed
and a response could be expected in 48 hours.
"BrianInHouston" wrote:
> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Server
> 2005. I setup a stored procedure to insert to the view, then (in Visual
> Studio) put a stop in the stored procedure. This works fine, until I try to
> step into the trigger. Then it tells me that no code is available.
> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won't
> allow me, saying "A breakpoint could not be inserted at this location".
> This only happens for any trigger on the view. If I try to set a breakpoint
> on a trigger on a table, it works fine.
> Does anyone know a way around this? I really would like to step though the
> trigger on the view.|||I don't know the answer to the debugging question, but yes, if you're an
MSDN subscriber and posted this using the account you registered when you
signed up for managed newsgroups, you should get a response within 2
business days. If you don't, the FAQ page points you at
https://support.microsoft.com/common/survey.aspx?scid=sw;en;1296&showpage=1&ws=msdn&sd=msdn&pa=msdnw
to contact the folks at MSDN about it.
The first thing to do, however, is to ensure that the alias that you're
posting with is registered properly. To do that, go to
http://msdn.microsoft.com/subscriptions/, sign in, and click the Managed
Newsgroups link.
--
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"BrianInHouston" <BrianInHouston@.discussions.microsoft.com> wrote in message
news:66D6AC1C-BB18-4FC4-B30C-F94D33A441E2@.microsoft.com...
> Is anyone going to respond to this? I thought these news groups were
> managed
> and a response could be expected in 48 hours.
> "BrianInHouston" wrote:
>> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL
>> Server
>> 2005. I setup a stored procedure to insert to the view, then (in Visual
>> Studio) put a stop in the stored procedure. This works fine, until I try
>> to
>> step into the trigger. Then it tells me that no code is available.
>> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it
>> won't
>> allow me, saying "A breakpoint could not be inserted at this location".
>> This only happens for any trigger on the view. If I try to set a
>> breakpoint
>> on a trigger on a table, it works fine.
>> Does anyone know a way around this? I really would like to step though
>> the
>> trigger on the view.
2005. I setup a stored procedure to insert to the view, then (in Visual
Studio) put a stop in the stored procedure. This works fine, until I try to
step into the trigger. Then it tells me that no code is available.
If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won't
allow me, saying "A breakpoint could not be inserted at this location".
This only happens for any trigger on the view. If I try to set a breakpoint
on a trigger on a table, it works fine.
Does anyone know a way around this? I really would like to step though the
trigger on the view.Is anyone going to respond to this? I thought these news groups were managed
and a response could be expected in 48 hours.
"BrianInHouston" wrote:
> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Server
> 2005. I setup a stored procedure to insert to the view, then (in Visual
> Studio) put a stop in the stored procedure. This works fine, until I try to
> step into the trigger. Then it tells me that no code is available.
> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won't
> allow me, saying "A breakpoint could not be inserted at this location".
> This only happens for any trigger on the view. If I try to set a breakpoint
> on a trigger on a table, it works fine.
> Does anyone know a way around this? I really would like to step though the
> trigger on the view.|||I don't know the answer to the debugging question, but yes, if you're an
MSDN subscriber and posted this using the account you registered when you
signed up for managed newsgroups, you should get a response within 2
business days. If you don't, the FAQ page points you at
https://support.microsoft.com/common/survey.aspx?scid=sw;en;1296&showpage=1&ws=msdn&sd=msdn&pa=msdnw
to contact the folks at MSDN about it.
The first thing to do, however, is to ensure that the alias that you're
posting with is registered properly. To do that, go to
http://msdn.microsoft.com/subscriptions/, sign in, and click the Managed
Newsgroups link.
--
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"BrianInHouston" <BrianInHouston@.discussions.microsoft.com> wrote in message
news:66D6AC1C-BB18-4FC4-B30C-F94D33A441E2@.microsoft.com...
> Is anyone going to respond to this? I thought these news groups were
> managed
> and a response could be expected in 48 hours.
> "BrianInHouston" wrote:
>> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL
>> Server
>> 2005. I setup a stored procedure to insert to the view, then (in Visual
>> Studio) put a stop in the stored procedure. This works fine, until I try
>> to
>> step into the trigger. Then it tells me that no code is available.
>> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it
>> won't
>> allow me, saying "A breakpoint could not be inserted at this location".
>> This only happens for any trigger on the view. If I try to set a
>> breakpoint
>> on a trigger on a table, it works fine.
>> Does anyone know a way around this? I really would like to step though
>> the
>> trigger on the view.
Debugging triggers on views in SQL Server 2005?
I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Server
2005. I setup a stored procedure to insert to the view, then (in Visual
Studio) put a stop in the stored procedure. This works fine, until I try to
step into the trigger. Then it tells me that no code is available.
If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won't
allow me, saying "A breakpoint could not be inserted at this location".
This only happens for any trigger on the view. If I try to set a breakpoint
on a trigger on a table, it works fine.
Does anyone know a way around this? I really would like to step though the
trigger on the view.Is anyone going to respond to this? I thought these news groups were manage
d
and a response could be expected in 48 hours.
"BrianInHouston" wrote:
> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Serve
r
> 2005. I setup a stored procedure to insert to the view, then (in Visual
> Studio) put a stop in the stored procedure. This works fine, until I try
to
> step into the trigger. Then it tells me that no code is available.
> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won
't
> allow me, saying "A breakpoint could not be inserted at this location".
> This only happens for any trigger on the view. If I try to set a breakpoi
nt
> on a trigger on a table, it works fine.
> Does anyone know a way around this? I really would like to step though th
e
> trigger on the view.|||I don't know the answer to the debugging question, but yes, if you're an
MSDN subscriber and posted this using the account you registered when you
signed up for managed newsgroups, you should get a response within 2
business days. If you don't, the FAQ page points you at
https://support.microsoft.com/commo...d=msdn&pa=msdnw
to contact the folks at MSDN about it.
The first thing to do, however, is to ensure that the alias that you're
posting with is registered properly. To do that, go to
http://msdn.microsoft.com/subscriptions/, sign in, and click the Managed
Newsgroups link.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"BrianInHouston" <BrianInHouston@.discussions.microsoft.com> wrote in message
news:66D6AC1C-BB18-4FC4-B30C-F94D33A441E2@.microsoft.com...[vbcol=seagreen]
> Is anyone going to respond to this? I thought these news groups were
> managed
> and a response could be expected in 48 hours.
> "BrianInHouston" wrote:
>|||Is anyone going to respond to this? I thought these news groups were manage
d
and a response could be expected in 48 hours.
"BrianInHouston" wrote:
> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Serve
r
> 2005. I setup a stored procedure to insert to the view, then (in Visual
> Studio) put a stop in the stored procedure. This works fine, until I try
to
> step into the trigger. Then it tells me that no code is available.
> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won
't
> allow me, saying "A breakpoint could not be inserted at this location".
> This only happens for any trigger on the view. If I try to set a breakpoi
nt
> on a trigger on a table, it works fine.
> Does anyone know a way around this? I really would like to step though th
e
> trigger on the view.|||I don't know the answer to the debugging question, but yes, if you're an
MSDN subscriber and posted this using the account you registered when you
signed up for managed newsgroups, you should get a response within 2
business days. If you don't, the FAQ page points you at
https://support.microsoft.com/commo...d=msdn&pa=msdnw
to contact the folks at MSDN about it.
The first thing to do, however, is to ensure that the alias that you're
posting with is registered properly. To do that, go to
http://msdn.microsoft.com/subscriptions/, sign in, and click the Managed
Newsgroups link.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"BrianInHouston" <BrianInHouston@.discussions.microsoft.com> wrote in message
news:66D6AC1C-BB18-4FC4-B30C-F94D33A441E2@.microsoft.com...[vbcol=seagreen]
> Is anyone going to respond to this? I thought these news groups were
> managed
> and a response could be expected in 48 hours.
> "BrianInHouston" wrote:
>
2005. I setup a stored procedure to insert to the view, then (in Visual
Studio) put a stop in the stored procedure. This works fine, until I try to
step into the trigger. Then it tells me that no code is available.
If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won't
allow me, saying "A breakpoint could not be inserted at this location".
This only happens for any trigger on the view. If I try to set a breakpoint
on a trigger on a table, it works fine.
Does anyone know a way around this? I really would like to step though the
trigger on the view.Is anyone going to respond to this? I thought these news groups were manage
d
and a response could be expected in 48 hours.
"BrianInHouston" wrote:
> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Serve
r
> 2005. I setup a stored procedure to insert to the view, then (in Visual
> Studio) put a stop in the stored procedure. This works fine, until I try
to
> step into the trigger. Then it tells me that no code is available.
> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won
't
> allow me, saying "A breakpoint could not be inserted at this location".
> This only happens for any trigger on the view. If I try to set a breakpoi
nt
> on a trigger on a table, it works fine.
> Does anyone know a way around this? I really would like to step though th
e
> trigger on the view.|||I don't know the answer to the debugging question, but yes, if you're an
MSDN subscriber and posted this using the account you registered when you
signed up for managed newsgroups, you should get a response within 2
business days. If you don't, the FAQ page points you at
https://support.microsoft.com/commo...d=msdn&pa=msdnw
to contact the folks at MSDN about it.
The first thing to do, however, is to ensure that the alias that you're
posting with is registered properly. To do that, go to
http://msdn.microsoft.com/subscriptions/, sign in, and click the Managed
Newsgroups link.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"BrianInHouston" <BrianInHouston@.discussions.microsoft.com> wrote in message
news:66D6AC1C-BB18-4FC4-B30C-F94D33A441E2@.microsoft.com...[vbcol=seagreen]
> Is anyone going to respond to this? I thought these news groups were
> managed
> and a response could be expected in 48 hours.
> "BrianInHouston" wrote:
>|||Is anyone going to respond to this? I thought these news groups were manage
d
and a response could be expected in 48 hours.
"BrianInHouston" wrote:
> I am trying to debug an "INSTEAD OF INSERT" trigger on a view in SQL Serve
r
> 2005. I setup a stored procedure to insert to the view, then (in Visual
> Studio) put a stop in the stored procedure. This works fine, until I try
to
> step into the trigger. Then it tells me that no code is available.
> If I try in Visual Studio 2005 to set a breakpoint on this trigger, it won
't
> allow me, saying "A breakpoint could not be inserted at this location".
> This only happens for any trigger on the view. If I try to set a breakpoi
nt
> on a trigger on a table, it works fine.
> Does anyone know a way around this? I really would like to step though th
e
> trigger on the view.|||I don't know the answer to the debugging question, but yes, if you're an
MSDN subscriber and posted this using the account you registered when you
signed up for managed newsgroups, you should get a response within 2
business days. If you don't, the FAQ page points you at
https://support.microsoft.com/commo...d=msdn&pa=msdnw
to contact the folks at MSDN about it.
The first thing to do, however, is to ensure that the alias that you're
posting with is registered properly. To do that, go to
http://msdn.microsoft.com/subscriptions/, sign in, and click the Managed
Newsgroups link.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"BrianInHouston" <BrianInHouston@.discussions.microsoft.com> wrote in message
news:66D6AC1C-BB18-4FC4-B30C-F94D33A441E2@.microsoft.com...[vbcol=seagreen]
> Is anyone going to respond to this? I thought these news groups were
> managed
> and a response could be expected in 48 hours.
> "BrianInHouston" wrote:
>
Subscribe to:
Posts (Atom)