Showing posts with label developed. Show all posts
Showing posts with label developed. Show all posts

Friday, March 30, 2012

Newbie question here - stored procedures

Hi I just installed sql server 2005 for the first time today. Anyways I have a bunch of stored procs from an application i developed on the SQL 2000 server. Anyways I am having a problem with one of my stored procedures.

CREATE PROCEDURE ProvinceRetrieveAdHoc

(@.whereClause VARCHAR(256))

AS

EXEC("SELECT * FROM tblProvince WHERE " + @.whereClause)

RETURN

GO

However this isn't working, I am getting this error:

Incorrect syntax near 'SELECT * FROM tblProvince WHERE '.

Now I am guessing the EXEC statement must have changed, as every stored proc that uses the exec command errors out with this same error. All my other procedures run just fine. Can anyone please tell me how to fix it?

THanks

oh wow nm, i figured it out.. just replaced double quotes with single.sql

Monday, March 19, 2012

Newbie needing help with joining 2 fields

I have a sql 2005 dev ed running an application developed in vs.net 2005 C# I have several gridviews which have a field call first name and a field called lastname I need to put both the firstname and lastname in the same cell or colum row. I do not now how to join these. Can some one help me with a SQL query string that will do this for me.You could do SELECT FirstName + ' ' + LastName FROM YourTable|||SELECT FirstName + ' ' + LastName AS FullName
FROM Employees

Wednesday, March 7, 2012

Newbie (MAC user) question: What is an SQL database... Or how to

Well this is not really the question... What I actually mean is: Is a SQL
database a file or an ensemble of files which can be developed on a PC, then
if the PC hasn't got a connection to the remote server, be transferred onto
a disk and copied into an SQL DBMS.
My problem is the following. I have decided to start developing web sites
which use ASP.NET and SQL on a Macintosh system. Not the best choice I
know...
My ISP has set up an SQL database which I need to populate with table,
columns and of course data. To do so I have found ASP Enterprise Manager
from the internet (http://www.aspenterprisemanager.com/) which allowed me to
create a table and a few other things, but because of the lack of manual I
am at a lost as to what else it can do and whether there is a better tool to
develop SQL on a Mac. Any suggestion about this would be very welcome.
By the way I have been able to connect to the db with Macromedia Dreamweaver
and I have created a form that loads data in the field. It's great to see it
working...
But to get back to my primary question... If I were to develop the SQL
database on a PC which as I said earlier doesn't have a connection to the
internet (it's an old one, you see), does it create a file, or a set of
files (the database, like an Access database would be a file) which can then
be transported to my Mac via a disk and sent to my ISP to upload in the SQL
DBMS to replace the one I have created with ASP Enterprise Manager.
Hope you make sense of these questions, and that you will come back with a
suggestion or two. Please no suggestion such as dump my Mac and buy a PC...
I love my Mac. I know it makes my life difficult at the moment, but which
relationship doesn't have it's difficult moments?
Merci beaucoup
William"William Lesourd" <william@.francodesign.com> wrote in message
news:BBC5CBC9.5166%william@.francodesign.com...
<snip>
> But to get back to my primary question... If I were to develop the SQL
> database on a PC which as I said earlier doesn't have a connection to the
> internet (it's an old one, you see), does it create a file, or a set of
> files (the database, like an Access database would be a file) which can
then
> be transported to my Mac via a disk and sent to my ISP to upload in the
SQL
> DBMS to replace the one I have created with ASP Enterprise Manager.
William,
Sql does indeed store it's databases in data files (default extension either
.mdf or .ndf) and a log file (.ldf). You would need to get the mdf file to
your ISP, but it is not simply a matter of them copying the file. They need
to attach the file to the database in order to tell SQL server about it.
Probably a better idea is to send them a back-up. In the SQL Server Master
database run the command:
BACKUP DATABASE mybase to file = 'c:\mybackup.bak', then your ISP can
restore it over your old database. (Or maybe your ASP manager can back it
up for you)
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003|||You could do your development on a different SQL Server than
the one which will eventually host the database (using the
same versions). After you have everything set, you can
either do a backup and then restore to the other SQL Server
or you can use sp_detach_db, copy the database files to the
other location and then reattach them with sp_attach_db.
As a side note and nothing to do with Macs - You can
download SQL Server books online...it might make things
easier for you:
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
-Sue
On Wed, 29 Oct 2003 19:55:53 +0000, William Lesourd
<william@.francodesign.com> wrote:
>But to get back to my primary question... If I were to develop the SQL
>database on a PC which as I said earlier doesn't have a connection to the
>internet (it's an old one, you see), does it create a file, or a set of
>files (the database, like an Access database would be a file) which can then
>be transported to my Mac via a disk and sent to my ISP to upload in the SQL
>DBMS to replace the one I have created with ASP Enterprise Manager.