Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, March 19, 2012

Installing SQL Server 2005 Express Ed

Hi All,

I'm new to programming and I've got to develop a db for a uni project. However after downloading SQL Server 2005 express ed, I found that I could not find the command prompt to start writing scripts (black and white DOS screem). I only have the configuration tool option in my menu (within that server configuration manager, error & usage reporting and server surface area config).

How do I get started with creating my database, please help....................

I'm I not looking in the right place for the console (command prompt to run scripts) or have I not downloaded the right stuff.

I need help urgently!!!

Thanks, in advance

First thing, if you haven't already done so, download and install the Documentation and Samples for SQL Server 2005 Express Edition:

http://www.microsoft.com/downloads/details.aspx?familyid=9697AAAA-AD4B-416E-87A4-A8B154F92787&displaylang=en

There are a few ways to get started creating databases, run scripts, etc:

1. Install SQL Server Management Studio Express:

http://www.microsoft.com/downloads/details.aspx?familyid=82afbd59-57a4-455e-a2d6-1d4c98d40f6e&displaylang=en

2. Install a Visual Studio Express version

3. Open up a command shell and run sqlcmd -S <server\instance>

jeff.

|||

I downloaded SQL Server 2005 developers edition and in first go I could only install Server. The setup did not install client tools, BOL etc. I had to manually goto CD2 and setup.exe to install client tools and BOL.

|||

Thanks for the reply

I have installed the documentation and samples and the management studio, but when trying to work through the samples, I get this error message, for some reason I can't include the Adventure works db. What can I'm I not doing


1> SELECT name from sys.databases
2> Go
name

--

master

tempdb

model

msdb


1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> USE [master]
2> GO
Changed database context to 'master'.
1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> select name from sys.databases
2> go
name

--

master

tempdb

model

msdb


(4 rows affected)
1>

Friday, March 9, 2012

integer count

Im not at all familiar with sql programming text but i need to do something I cant find an example of. Im using the sql query inside of an access 2003 database. Basicall I have two tables. One that hold all the employees personal informaton AS WELL AS Total Days Worked AND TotalPoints.

A day worked is represented by a "w" form within my vb program.
I used to sql code:
SELECT COUNT(*) AS TotalDW
FROM TblEmpAttendance
WHERE Value="w" And TblEmployee.EmployeeID=TblEmpAttendance.EmployeeID ;

To get the "w" total or count in this case.

--This seems to work without a problem please let me know if you see a problem with it.

--Now on to my bigger problem.

The second table has 3 fields-- EmployeeID, Date,Value
The date comes from my vb program(a calendar with textfields to hold values)

However-- to limit the code I use in my vb program I wanted to take a point total for all points from the 2nd tbl

In vb I can use --IF Isnumeric --But I have no clue how to do it woth SQL code!!

A Point Value can only be 1 of 4 values(a 1,2,3 or a 7)

But how do I rewrite the below code(if below code is even close!) to count all of the numeric values for the field "Value" when not every entry for "Value is a numeric entry?

SELECT COUNT(*) AS TotalPoints
FROM TblEmpAttendance
WHERE Value= '1 or 2 or 3 or 7' And TblEmployee.EmployeeID=TblEmpAttendance.EmployeeID ;

Hopefully I explained sufficiently..Thanks In advance!Did you try:

SELECT COUNT(*) AS TotalPoints
FROM TblEmpAttendance
WHERE Value IN ('1', '2', '3', '7')
And TblEmployee.EmployeeID=TblEmpAttendance.EmployeeID ;
;)|||Nope but I will now..Thanks Much! it is highly appreciated..Just tried it...I only have 4 sample employees to check it with but it seems to work...
Many thanks!!!

Wednesday, March 7, 2012

Installing SQL Express in Laptop

I am trying to install MS SQL Express Advanced in my Laptop to be used in conjunction with ColdFusion programming environment. Abs newbe with MSSQL.

It looks like the Management Studio Express has not been installed. I have tried to install the 64bits stand alone from msdn.microsoft. but my processor does not support it.

Please please advise.
ThankYou very much

ContiW

go here and download the 32-bit (default) mgmt studio express edition.

http://msdn.microsoft.com/vstudio/express/sql/download/