Showing posts with label order. Show all posts
Showing posts with label order. Show all posts

Tuesday, March 27, 2012

Can't start SQL Server after renaming the server

I can't start SQL Server after my Windows 2003 server has been renamed.
Do I have to reinstall SQL in order to rename it?
Thank you for your help!
Leon
What version of SQL Server? Anything in the SQL Server errorlog file? Here you might find something
useful: http://www.karaszi.com/SQLServer/inf...erver_name.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in message
news:4E806193-B9A6-4659-BE21-C9EB2B57B49E@.microsoft.com...
>I can't start SQL Server after my Windows 2003 server has been renamed.
> Do I have to reinstall SQL in order to rename it?
> Thank you for your help!
> Leon
sql

Can't start SQL Server after renaming the server

I can't start SQL Server after my Windows 2003 server has been renamed.
Do I have to reinstall SQL in order to rename it?
Thank you for your help!
LeonWhat version of SQL Server? Anything in the SQL Server errorlog file? Here y
ou might find something
useful: http://www.karaszi.com/SQLServer/in...server_name.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in me
ssage
news:4E806193-B9A6-4659-BE21-C9EB2B57B49E@.microsoft.com...
>I can't start SQL Server after my Windows 2003 server has been renamed.
> Do I have to reinstall SQL in order to rename it?
> Thank you for your help!
> Leon

Can't start SQL Server after renaming the server

I can't start SQL Server after my Windows 2003 server has been renamed.
Do I have to reinstall SQL in order to rename it?
Thank you for your help!
LeonWhat version of SQL Server? Anything in the SQL Server errorlog file? Here you might find something
useful: http://www.karaszi.com/SQLServer/info_change_server_name.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in message
news:4E806193-B9A6-4659-BE21-C9EB2B57B49E@.microsoft.com...
>I can't start SQL Server after my Windows 2003 server has been renamed.
> Do I have to reinstall SQL in order to rename it?
> Thank you for your help!
> Leon

Sunday, March 25, 2012

Cant sort a text field!

Hi
ive got a table and contains a surname text field. Why cant i do a select statement ORDER BY surname. I get an error saying i cant sort a text field! how do i go around it!

thanksYou do ANSI SQL ALTER Table and change text to Varchar 40 because text cannot be used for things like name that can be covered with Varchar 40 or 50 at most. Then do ORDER BY. Hope this helps.|||

Your surname filed is a text datatype field which cannot be sorted.

You need change this field to varchar(50) or nvarchar(50) data type to allow you sort on it.

Limno

Saturday, February 25, 2012

Cant order by text values?

Hi,

I've got the following code that pulls out forum topics that have been added to on a particular day:

SELECT
forum_posts.post_date
, forum_threads.id
, forum_threads.subject
FROM forum_threads INNER JOIN forum_posts
ON forum_posts.thread_id = forum_threads.id
WHERE day(post_date)=day(getdate())
AND month(post_date)=month(getdate())
AND year(post_date)=year(getdate())
GROUP BY forum_threads.id
,forum_threads.subject
,forum_posts.post_date
ORDER BY forum_threads.id ASC, forum_posts.post_date ASC

I tried including the body of the post in this:

SELECT
forum_posts.post_date
, forum_posts.body
, forum_threads.id
, forum_threads.subject
FROM forum_threads INNER JOIN forum_posts
ON forum_posts.thread_id = forum_threads.id
WHERE day(post_date)=day(getdate())
AND month(post_date)=month(getdate())
AND year(post_date)=year(getdate())
GROUP BY forum_threads.id
,forum_threads.subject
,forum_posts.post_date
,forum_posts.body
ORDER BY forum_threads.id ASC, forum_posts.post_date ASC

But was told that "The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator."

Well, the body field is text datatype alright, but how do I therefore include it in the results?The GROUP BY is what it is complaining about. Why is that there?

Originally posted by Spudhead
Hi,

I've got the following code that pulls out forum topics that have been added to on a particular day:

SELECT
forum_posts.post_date
, forum_threads.id
, forum_threads.subject
FROM forum_threads INNER JOIN forum_posts
ON forum_posts.thread_id = forum_threads.id
WHERE day(post_date)=day(getdate())
AND month(post_date)=month(getdate())
AND year(post_date)=year(getdate())
GROUP BY forum_threads.id
,forum_threads.subject
,forum_posts.post_date
ORDER BY forum_threads.id ASC, forum_posts.post_date ASC

I tried including the body of the post in this:

SELECT
forum_posts.post_date
, forum_posts.body
, forum_threads.id
, forum_threads.subject
FROM forum_threads INNER JOIN forum_posts
ON forum_posts.thread_id = forum_threads.id
WHERE day(post_date)=day(getdate())
AND month(post_date)=month(getdate())
AND year(post_date)=year(getdate())
GROUP BY forum_threads.id
,forum_threads.subject
,forum_posts.post_date
,forum_posts.body
ORDER BY forum_threads.id ASC, forum_posts.post_date ASC

But was told that "The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator."

Well, the body field is text datatype alright, but how do I therefore include it in the results?|||Because I'm a muppet.

Thanks :)|||Make this...

SELECT
forum_threads.id
,forum_threads.subject
,forum_posts.post_date
FROM forum_threads INNER JOIN forum_posts
ON forum_posts.thread_id = forum_threads.id
GROUP BY forum_threads.id
,forum_threads.subject
,forum_posts.post_date
HAVING day(post_date)=day(getdate())
AND month(post_date)=month(getdate())
AND year(post_date)=year(getdate())
ORDER BY forum_threads.id, forum_posts.post_date

...the option ASC is default;
...use the command Having.