last day (4319 days later) » 

4:40 PM
:)
 
I thought there should be a SQL room, so here it is. Welcome everyone!
 
cool so i can ask you and me what the hell those smart dudes in DBA were talking about with extend properties
@KendallFrey yeah im surprised there hasnt been one made before
 
I have no idea what extend properties are.
I mean this room to be about the SQL language, not SQL Server, MySQL, or any other DBMS.
Any question about using SQL in a specific DBMS is welcome.
 
why does the following not work then?
USE HistoricalData
GO

CREATE PROC GetSProcList
AS
/*
Author:  FrazMan
Date:    17-05-2012
Purpose: Obtains info on all SProc's in this database.
*/
BEGIN
	SELECT * from dbo.StoredProcedureList
END
i get the following error
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'GO'.
Msg 111, Level 15, State 1, Line 1
'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.
 
Hmm
Why do you use BEGIN/END?
 
4:48 PM
it was in the example jcolebrand gave me
USE [SpecificDatabase]
GO

CREATE PROC GetDays
	@Offset INT
AS
/*
Author:  cbrand
Date:    2012-05-11
Purpose: To demonstrate sprocs
*/
BEGIN

	SELECT
		  GETDATE() + @Offset AS TODAY
		, GETDATE() + @Offset + 1 AS TOMORROW

END
 
I don't think it's necessary. I doubt that will solve the problem though.
 
still get an error if i take begin end out
 
Yeah figured.
What we need is some SQL gurus in here.
 
indeed
give me about o... maybe 10 yrs
and i MIGHT be eligable
lol
 
SQL isn't that hard.
 
4:58 PM
guess not but trying to learn this sh-t by urself is
 
I stuck with the basics of create/alter/drop table/database and insert/select/update/delete
 
yeah im starting to wonder if the DBA dudes are suggesting something which is just going to cause me more issues than its worth. atleast until i learn more
@KendallFrey random but how long did it take u to get competent in c# btw?
 
Hiya
 
@SPFiredrake hey, cheers bro
firstly how do u mean "Don't forget to also get all the different limits for datatypes when you query the sprocs."
 
5:13 PM
varchar(100) = varchar DATA_TYPE, 100 for CHARACTER_MAXIMUM_LENGTH
 
yeah ok...
i thought sqldatareader returned objects though so ....
 
You also have NUMERIC_PRECISION, NUMERIC_SCALE, DATETIME_PRECISION
 
or am i missing the point
 
For parameters, you're providing the data.
You need to make sure the data is valid for the sproc params.
Otherwise it will fail.
 
ahh ok yeah
 
5:15 PM
You have a sproc with varchar(10) parameters and give it a long string, it will just concat to 10 characters and plug away happily.
 
concat = truncate?
 
yeah
so im assuming i need to set up code in c# which will take the input and compare it against the relevant datatype in c#
using the datatype mapping
@SPFiredrake could you do me one more favour please?
could you post ur sql code here and i will mark it as the answer
0
Q: Stored procedure list and parameter number used in conjunction with ComboBox

Hans RudelI'm trying to get a list of all the user defined stored procedures to populate a combobox with. The idea was to manually create a table with the following columns: SProc Name, Number of Inputs, Parameter 1, Parameter 2 ... The user is meant to click a button and a SProc selects all this da...

 
Done.
 
5:30 PM
@SPFiredrake thanks so much for all your help!
 
 
2 hours later…
7:55 PM
I have a question...
ahh I'll just make a post
 
You can ask it here. This is a new room, so the more activity we have the better.
You could post a link to a question too.
 
8:31 PM
@KendallFrey You have more patience for that Javier guy than I care to right now...
 
Just doesn't get it...
 
8:53 PM
@KendallFrey @SPFiredrake just to set the record straight i really appreciate all the time/help u guys have given me. I do realise i sometimes ask stupid questions + if i do start pissing u guys off please say so as thats the last thing i want to do
 
@HansRudel Not at all. The other guy that I'm trying to avoid just refuses to think about the problem and just wants answers.
 
just wanted to let u guys know as u have both been really helpful
 

  last day (4319 days later) »