Hello everyone
I was perusing the threads and found a helpful link that Aaron Bertrand
posted http://www.aspfaq.com/5006. In short it expalined the three things
(DDL, sample data and expected results) that should be given to increase my
chances that my query question would be answered. I was wondering are there
other suggestions that would be helpful to getting questions answered? Are
there suggestions for different objects such as stored procedures, triggers,
function? Maybe I am asking for a lot but, what can you expect from a newbie
.
kw_uh97of course the question should be interesting ;)
--
"kw_uh97" wrote:
> Hello everyone
> I was perusing the threads and found a helpful link that Aaron Bertrand
> posted http://www.aspfaq.com/5006. In short it expalined the three things
> (DDL, sample data and expected results) that should be given to increase m
y
> chances that my query question would be answered. I was wondering are ther
e
> other suggestions that would be helpful to getting questions answered? Are
> there suggestions for different objects such as stored procedures, trigger
s,
> function? Maybe I am asking for a lot but, what can you expect from a newb
ie.
> kw_uh97|||Really that link should pretty much cover it. Triggers, views, and stored
procedures should be scripted the same as tables, and any pertinant
information should be posted.
Posting "you don't need DDL to answer this question" after being asked for
DDL is usually bad form and might get you flamed or ignored. But since you
took the time to post this question, you seem concerned enough that you
would not give such a response anyway.
As long as you appear to be trying to help everyone understand your issue,
you should find folks very willing to help.
Some folks get upset if you use the wrong terminology. If you ever call a
collumn a field, a table a file, or a row a record, CELKO will beat you up
and then go drown a kitten. Have a thick skin when this happens and you'll
be all set.
"kw_uh97" <kwuh97@.discussions.microsoft.com> wrote in message
news:148DFE63-0D24-4036-8FD2-A929919DC903@.microsoft.com...
> Hello everyone
> I was perusing the threads and found a helpful link that Aaron Bertrand
> posted http://www.aspfaq.com/5006. In short it expalined the three things
> (DDL, sample data and expected results) that should be given to increase
my
> chances that my query question would be answered. I was wondering are
there
> other suggestions that would be helpful to getting questions answered? Are
> there suggestions for different objects such as stored procedures,
triggers,
> function? Maybe I am asking for a lot but, what can you expect from a
newbie.
> kw_uh97|||One more... This is a personal peeve of mine.
If you ask a question, always post the solution when you find it. It is
very poor form to ask others for help but not post the final solution for
the next person who tries to search for it, or anyone who is following the
thread in hopes of learning something new. Basically, share what you learn
so others can benefit from it.
"kw_uh97" <kwuh97@.discussions.microsoft.com> wrote in message
news:148DFE63-0D24-4036-8FD2-A929919DC903@.microsoft.com...
> Hello everyone
> I was perusing the threads and found a helpful link that Aaron Bertrand
> posted http://www.aspfaq.com/5006. In short it expalined the three things
> (DDL, sample data and expected results) that should be given to increase
my
> chances that my query question would be answered. I was wondering are
there
> other suggestions that would be helpful to getting questions answered? Are
> there suggestions for different objects such as stored procedures,
triggers,
> function? Maybe I am asking for a lot but, what can you expect from a
newbie.
> kw_uh97|||When you post the DDL, clean it up so that people can read it. A lot
of people just "push the button" and paste raw generated scripts with
square brackets, irregular capitalization, keys and constraitns as
ALTER TABLE statements, etc.
I have a book on SQL programming style and yhou can find some tools to
format the code nicely.
It helps to give some idea as to the business problem, so people can
make good guesses.|||Thanks Omnibuzz I'll try to keep it interesting.
Thanks Jim I will take all of your advice. Just some simple questions, when
you say all trigger, stored procedures etc... should be "scripted" are you
talking about the actual code to create the objects or something other than
that. Moreover, I found that the script option to create the table structure
was helpful plus I found a utility SQL Scripter, that created insert
statements to create sample data from my existing data helpful in posting
questions as well. Are they anymore tools, utilities or software that can
make posting question to the board more effective or make my development
efforts more effecient?
Thanks In advance.
kw
"Jim Underwood" wrote:
> One more... This is a personal peeve of mine.
> If you ask a question, always post the solution when you find it. It is
> very poor form to ask others for help but not post the final solution for
> the next person who tries to search for it, or anyone who is following the
> thread in hopes of learning something new. Basically, share what you lear
n
> so others can benefit from it.
> "kw_uh97" <kwuh97@.discussions.microsoft.com> wrote in message
> news:148DFE63-0D24-4036-8FD2-A929919DC903@.microsoft.com...
> my
> there
> triggers,
> newbie.
>
>|||For the stored procedures, triggers, etc., I mean post the full code used to
create (or alter) the object. Also, as CELKO pointed out, formatting the
code so it is readable is a big thing. If we can read it easily, we will be
able to understand it in order to answer the question. You can script most
objects from EM by right clicking on them.
I don't know any other tools off hand.
"kw_uh97" <kwuh97@.discussions.microsoft.com> wrote in message
news:3DE501C5-DB4C-4B13-8ACF-CC634D65FF80@.microsoft.com...
> Thanks Omnibuzz I'll try to keep it interesting.
> Thanks Jim I will take all of your advice. Just some simple questions,
when
> you say all trigger, stored procedures etc... should be "scripted" are you
> talking about the actual code to create the objects or something other
than
> that. Moreover, I found that the script option to create the table
structure
> was helpful plus I found a utility SQL Scripter, that created insert
> statements to create sample data from my existing data helpful in posting
> questions as well. Are they anymore tools, utilities or software that can
> make posting question to the board more effective or make my development
> efforts more effecient?
> Thanks In advance.
> kw
> "Jim Underwood" wrote:
>
for
the
learn
Bertrand
things
increase
Are|||Jim when I script a stored procedure from EM there is some code that is adde
d
to the stored procedure. Namely this if exist statement. Should all of this
code be included or should I exclude this and post my sp as is.
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[DebugA]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[DebugA]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure DebugA
(
@.IntIn int,
@.IntOut int OUTPUT
)
as
Set @.IntOut = @.IntIn + 10
Return
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Thanks In Advance
kw
"Jim Underwood" wrote:
> For the stored procedures, triggers, etc., I mean post the full code used
to
> create (or alter) the object. Also, as CELKO pointed out, formatting the
> code so it is readable is a big thing. If we can read it easily, we will
be
> able to understand it in order to answer the question. You can script mos
t
> objects from EM by right clicking on them.
> I don't know any other tools off hand.
> "kw_uh97" <kwuh97@.discussions.microsoft.com> wrote in message
> news:3DE501C5-DB4C-4B13-8ACF-CC634D65FF80@.microsoft.com...
> when
> than
> structure
> for
> the
> learn
> Bertrand
> things
> increase
> Are
>
>|||ahhhh...
The if exists.. then drop is not needed, it just clutters up the code. The
create by itself should be sufficient. However, most folks include drop
statements at the end of their code snippets to remove all the objects that
were created. This keeps our environment from getting filled up with test
tables and procedures, and saves us the extra keystrokes of manually
dropping these objects.
i.e.
Create table ProblemTable1 (column list...)
Constraints, etc...
Create table ProblemTable2 (column list...)
Constraints, etc...
Insert into ProblemTable1 (column list) values (value list);
Insert into ProblemTable2 (column list) values (value list);
select * from ProblemTable1
<some join> on ProblemTable2
where ....
drop ProblemTable1;
drop ProblemTable2 ;
"kw_uh97" <kwuh97@.discussions.microsoft.com> wrote in message
news:EACEFF81-50A6-4230-BE48-8930A939CA42@.microsoft.com...
> Jim when I script a stored procedure from EM there is some code that is
added
> to the stored procedure. Namely this if exist statement. Should all of
this
> code be included or should I exclude this and post my sp as is.
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[DebugA]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
> drop procedure [dbo].[DebugA]
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> SET ANSI_NULLS ON
> GO
> CREATE procedure DebugA
> (
> @.IntIn int,
> @.IntOut int OUTPUT
> )
> as
> Set @.IntOut = @.IntIn + 10
> Return
>
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
> Thanks In Advance
> kw
>
> "Jim Underwood" wrote:
>
used to
the
will be
most
you
posting
can
development
It is
solution
following
you
are
answered?
from a|||As others have stated, clean DDL and a statement of the business
problem is always helpful; however, you may not be able to post the
entire code (because of business restrictions or the complexity of the
code). In those cases, spend the time to develop a working bare-bones
test case that illustrates the problem you have. I don't need all 50
columns in a table when you're only having issues with two of them, but
it would be nice to have a stipped down version of your problem that
actually works and illustrates the problem you are having.
HTH,
Stu
No comments:
Post a Comment