Showing posts with label library. Show all posts
Showing posts with label library. Show all posts

Monday, March 19, 2012

Did I just trip over a golden egg?

I'v been scouring the MSDN library and asking in newsgroups, forums, etc. on a way to extract [only] the time from a DateTime field (for a stored procedure) and no one could answer my question. then I tried this in QA:

selectright(getdate(),7)

and I found an answer. I'm now looking for someone to prove this is either a golden egg, a goose egg, or a documented feature I missed and if so where, so I can learn from it.

Jon

This will work,if you know what the default locale of the Sql Server is set as. However, if you don't, then you could get a nasty shock. For instance, if the server happened to be using ISO8601 dateformats then you would get something meaningless back.

Try

SELECT Right(CONVERT(varchar,GetDate(),126),7)

to see what I mean. The safest way to do what you are doing would be:

SELECT LTRIM(Right(CONVERT(varchar,GetDate(),0),7))

That should guarantee you are getting the correct dateformat string to work with. There's nothing mysterious about the RIGHT function, either - most SQL languages have a substring function.|||

Thank you and I accept the safest way as you suggested. The RIGHT function wasn't mysterious to me but rather the tool I used to get the answer I wanted. I was looking for an easy means to retrieve the time from SQL and was frustrated nobody out there could answer a question I thought would be a standard novice question. I'm realizing the simplest things are the cause of the greatest frustration in the programming world. Thanks for your solution.

Jon

|||Actually, I would suggest this:
SELECT CONVERT(char(12),GETDATE(),114)

For this datetime value:
2005-12-17 20:55:27.060

This would be returned:
20:55:27:060

SeeCAST and CONVERT for more information on how to use these 2 functions.|||

Thank You Terri! I was not familiar with CONVERT and now it seems ALL my date problems can be solved by this new information.

Jon

|||

Hmmm... that's interesting. To tell you the truth, I would have just used a whole bunch of datepart functions myself :)

Friday, February 17, 2012

Developer 2005 Connection Limit

Hi Jim
Maximum Capacity specifications are available at
http://msdn2.microsoft.com/en-us/library/ms143432.aspx You can have 32,767
user connections.
John
"Jim Norton" wrote:

> I have looked online but cannot find a clear answer to whether Microsoft S
QL
> Server 2005 Developer Edition has a maximum connection limit? I see that
> SQL Express has 25 maximum connections.
> If anyone knows that answer it would be greatly appreciated.
> Thanks!
>
>Hi Jim
I would be interested where you got 25 connections from!
http://www.microsoft.com/technet/pr...sqlexpress.mspx
states
Note: If SQL Server 2005 Express is running on Windows XP Home, it is
limited to five simultaneous connections. If it is running on Windows 2000 o
r
Windows XP Professional, it is limited to 10 simultaneous connections.
However, these are limitations of the operating system and not of SQL Server
2005 Express.
But nothing about any other limit!
John
"John Bell" wrote:
[vbcol=seagreen]
> Hi Jim
> Maximum Capacity specifications are available at
> http://msdn2.microsoft.com/en-us/library/ms143432.aspx You can have 32,767
> user connections.
> John
> "Jim Norton" wrote:
>|||Hi John,
Funny, I can't find where I found that but it appears you are correct. I
saw some references online that the Devloper edition of SQL may or may not
have a CAL or connection limit imposed because it is intended for
development purposes only and I am trying to determine if that will impact
my test environment before I set it up. The Max Capacity specs dont really
break down the different versions so I am still a little nervous.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:81BA8EF8-E085-4377-BC85-68F5722434E7@.microsoft.com...[vbcol=seagreen]
> Hi Jim
> I would be interested where you got 25 connections from!
> http://www.microsoft.com/technet/pr...sqlexpress.mspx
> states
> Note: If SQL Server 2005 Express is running on Windows XP Home, it is
> limited to five simultaneous connections. If it is running on Windows 2000
> or
> Windows XP Professional, it is limited to 10 simultaneous connections.
> However, these are limitations of the operating system and not of SQL
> Server
> 2005 Express.
> But nothing about any other limit!
> John
> "John Bell" wrote:
>|||I have looked online but cannot find a clear answer to whether Microsoft SQL
Server 2005 Developer Edition has a maximum connection limit? I see that
SQL Express has 25 maximum connections.
If anyone knows that answer it would be greatly appreciated.
Thanks!|||Hi Jim
Maximum Capacity specifications are available at
http://msdn2.microsoft.com/en-us/library/ms143432.aspx You can have 32,767
user connections.
John
"Jim Norton" wrote:

> I have looked online but cannot find a clear answer to whether Microsoft S
QL
> Server 2005 Developer Edition has a maximum connection limit? I see that
> SQL Express has 25 maximum connections.
> If anyone knows that answer it would be greatly appreciated.
> Thanks!
>
>|||Hi Jim
I would be interested where you got 25 connections from!
http://www.microsoft.com/technet/pr...sqlexpress.mspx
states
Note: If SQL Server 2005 Express is running on Windows XP Home, it is
limited to five simultaneous connections. If it is running on Windows 2000 o
r
Windows XP Professional, it is limited to 10 simultaneous connections.
However, these are limitations of the operating system and not of SQL Server
2005 Express.
But nothing about any other limit!
John
"John Bell" wrote:
[vbcol=seagreen]
> Hi Jim
> Maximum Capacity specifications are available at
> http://msdn2.microsoft.com/en-us/library/ms143432.aspx You can have 32,767
> user connections.
> John
> "Jim Norton" wrote:
>|||Hi John,
Funny, I can't find where I found that but it appears you are correct. I
saw some references online that the Devloper edition of SQL may or may not
have a CAL or connection limit imposed because it is intended for
development purposes only and I am trying to determine if that will impact
my test environment before I set it up. The Max Capacity specs dont really
break down the different versions so I am still a little nervous.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:81BA8EF8-E085-4377-BC85-68F5722434E7@.microsoft.com...[vbcol=seagreen]
> Hi Jim
> I would be interested where you got 25 connections from!
> http://www.microsoft.com/technet/pr...sqlexpress.mspx
> states
> Note: If SQL Server 2005 Express is running on Windows XP Home, it is
> limited to five simultaneous connections. If it is running on Windows 2000
> or
> Windows XP Professional, it is limited to 10 simultaneous connections.
> However, these are limitations of the operating system and not of SQL
> Server
> 2005 Express.
> But nothing about any other limit!
> John
> "John Bell" wrote:
>|||"Jim Norton" <joe@.joe.com> wrote in message
news:%23dETmctmGHA.4728@.TK2MSFTNGP05.phx.gbl...
> Hi John,
> Funny, I can't find where I found that but it appears you are correct. I
> saw some references online that the Devloper edition of SQL may or may not
> have a CAL or connection limit imposed because it is intended for
> development purposes only and I am trying to determine if that will impact
> my test environment before I set it up. The Max Capacity specs dont
really
> break down the different versions so I am still a little nervous.
The Developer edition is "basically" the Enterprise Edition, but licensed
for developer use only.
I haven't heard about SQL 2005 Express having any inherent limits itself.

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:81BA8EF8-E085-4377-BC85-68F5722434E7@.microsoft.com...
http://www.microsoft.com/technet/pr...sqlexpress.mspx[vbcol=seagreen]
2000[vbcol=seagreen]
>|||"Jim Norton" <joe@.joe.com> wrote in message
news:%23dETmctmGHA.4728@.TK2MSFTNGP05.phx.gbl...
> Hi John,
> Funny, I can't find where I found that but it appears you are correct. I
> saw some references online that the Devloper edition of SQL may or may not
> have a CAL or connection limit imposed because it is intended for
> development purposes only and I am trying to determine if that will impact
> my test environment before I set it up. The Max Capacity specs dont
really
> break down the different versions so I am still a little nervous.
The Developer edition is "basically" the Enterprise Edition, but licensed
for developer use only.
I haven't heard about SQL 2005 Express having any inherent limits itself.

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:81BA8EF8-E085-4377-BC85-68F5722434E7@.microsoft.com...
http://www.microsoft.com/technet/pr...sqlexpress.mspx[vbcol=seagreen]
2000[vbcol=seagreen]
>|||Hi Jim
You could look at SELECT @.@.MAX_CONNECTIONS to see what value you have! It
could be that your system is overloaded in other areas before the maximim
number of connections is reached.
John
"Jim Norton" wrote:

> Hi John,
> Funny, I can't find where I found that but it appears you are correct. I
> saw some references online that the Devloper edition of SQL may or may not
> have a CAL or connection limit imposed because it is intended for
> development purposes only and I am trying to determine if that will impact
> my test environment before I set it up. The Max Capacity specs dont reall
y
> break down the different versions so I am still a little nervous.
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:81BA8EF8-E085-4377-BC85-68F5722434E7@.microsoft.com...
>
>