Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query grid

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

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

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-24 : 11:58:34
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

590 Posts

Posted - 2006-11-27 : 08:52:36
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

30421 Posts

Posted - 2006-11-27 : 09:00:41
Copy the T-SQL and create a new view or SP.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-27 : 10:00:00
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

590 Posts

Posted - 2006-11-27 : 10:37:10
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
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-27 : 11:17:58
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

22864 Posts

Posted - 2006-11-28 : 04:32:32
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

590 Posts

Posted - 2006-11-28 : 06:09:24
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 - 2006-11-28 : 06:26:59
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

590 Posts

Posted - 2006-11-28 : 09:55:39
Many thanks madhuotp
Go to Top of Page
   

- Advertisement -