Showing posts with label prompt. Show all posts
Showing posts with label prompt. Show all posts

Friday, March 30, 2012

How can i connect to sql sever 2005 express from the command prompt.

Iam trying to connect to local copy of sql sever express from the command prompt with this command(sqlcmd) but i get the error below. What should i do to overcome the error. Basically what i want to do is to try out some commandline backup utilities and i deadly want to know how to do a backup from the command prompt. Help is greatly appreciated.

HResult 0x2, level 16, state 1

Named pipes provider: could not open a connection to sql sever [2]

sqlcmd: Error: Microsft sql native client: An error has occurred while estarblishing a connection to the sever. When connecting to sql sever 2005, this failure may be caused by the fact that under the default settings SQL sever does not allow remote connections..

Sqlcmd: Error: Microsoft sql native client: Login time out expired.

Assuming you have the server name correct I would check in the control panel --> administrative tools --> Services and make sure that sql express is running|||I got it right. Looks like it was a typing mistake. But i have one question here, backingup a database from the command prompt to me looks tiresome. What is likely to go wrong if i just copied my projects folder from the production sever to a nother machine where i want the backup to be insteady of going through all these good but confusing steps. I i just copied the folder to a nother location or computer, are the end results not the same with if i had follwed all these database backup procedures. Dont laugh at me, iam still new to this stuff.|||

Hi,

This might be caused since SQL Server 2005 does not allow remote connection under default configuration. Please enable this according to the following KB article.

http://support.microsoft.com/kb/914277/en-us

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Wednesday, March 7, 2012

Hours/minutes in the Calendar date time prompt

Is there any way to get teh date time prompt to display hours & minutes? For example, if I default the field to '=Today', I would like to see '8/10/2006 9:04 AM' instead of '8/10/2006'

Similarly, when I pick a date using the date picker control that is displayed by default, I would like it to also display the time, which I guess would default to 12:00 AM.

Thanks in advance!

I have a report parameter set using :

=DateSerial(Year(now()), Month(now()), 0) that displays the last day of the month as default and when you view the report the end date is populated as:

7/31/2006 12:00:00 AM

does that help?

|||

Hi,

I encountered the same situation once and this is what I did:

in the report parameter --> default values, write the following expression

=today().addseconds(1). This will display the data and time when you run the report. The only thing is that for the default value it will add 1 second.

--Amde

|||

Thanks...your replies got me off on the right path. I ended up using the following:

=DateAdd("h",12,Today)

and

=now

I had been using =Today which just returns a date. Duh.