SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query grid
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Pinto
Aged Yak Warrior

United Kingdom
590 Posts

Posted - 11/24/2006 :  11:11:31  Show Profile  Reply with Quote
Is it possible to have a design grid in SQL server like the one you have in Access when you create a query ?

snSQL
Flowing Fount of Yak Knowledge

USA
1837 Posts

Posted - 11/24/2006 :  11:58:34  Show Profile  Reply with Quote
Modify the table or edit the data in the table in Enterprise Manager (2000) or SQL Server Management Studio (2005) (right click the table to get those options).
Go to Top of Page

Pinto
Aged Yak Warrior

United Kingdom
590 Posts

Posted - 11/27/2006 :  08:52:36  Show Profile  Reply with Quote
Thanks very much. Is there any way you can save the query you build and run byt referring to the name (as in Access) or would the nearest way be to put the SQL statement it builds into a stored procedure.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30117 Posts

Posted - 11/27/2006 :  09:00:41  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Copy the T-SQL and create a new view or SP.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22744 Posts

Posted - 11/27/2006 :  10:00:00  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Note that in Access to execute the saved query, you should use

Select columns from StoredQuery

but in sql server if you use stored procedure you need to use using
EXEC spname list_of_parameters

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Pinto
Aged Yak Warrior

United Kingdom
590 Posts

Posted - 11/27/2006 :  10:37:10  Show Profile  Reply with Quote
Thanks to you all.

So if I pass 3 parameters to my sp would my sp look like this below

CreateProcedure MySP

AS
@FirstName
@Surname
@DateOfBirth


Exec MySPName @Firstname, @Surname, @DateOfBirth
GO


In my asp.net I'd call this to fill my dataset ?
Go to Top of Page

snSQL
Flowing Fount of Yak Knowledge

USA
1837 Posts

Posted - 11/27/2006 :  11:17:58  Show Profile  Reply with Quote
You must declare the parameters before the AS keyword, and specify datatypes, something like this

Create Procedure MySP
@FirstName varchar(50),
@Surname varchar(50),
@DateOfBirth datetime
AS
...
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22744 Posts

Posted - 11/28/2006 :  04:32:32  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Read about Stored procedures in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Pinto
Aged Yak Warrior

United Kingdom
590 Posts

Posted - 11/28/2006 :  06:09:24  Show Profile  Reply with Quote
Do you meanin Enterprise manager ? If not where do I find sql server help file ?

TIA
Go to Top of Page

madhuotp
Yak Posting Veteran

78 Posts

Posted - 11/28/2006 :  06:26:59  Show Profile  Reply with Quote
Refer Books On Line which is by default installed with the EM. if it is not there u can download from
http://search.technet.microsoft.com/search/default.aspx?siteId=1&tab=0&query=download+books+online

Madhu
Go to Top of Page

Pinto
Aged Yak Warrior

United Kingdom
590 Posts

Posted - 11/28/2006 :  09:55:39  Show Profile  Reply with Quote
Many thanks madhuotp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000