Click here to Skip to main content
15,892,161 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralOT Pin
Pete O'Hanlon21-Aug-13 5:10
mvePete O'Hanlon21-Aug-13 5:10 
GeneralRe: OT Pin
PB 369,78321-Aug-13 5:17
PB 369,78321-Aug-13 5:17 
GeneralRe: OT Pin
Pete O'Hanlon21-Aug-13 5:18
mvePete O'Hanlon21-Aug-13 5:18 
GeneralRe: OT Pin
PB 369,78321-Aug-13 5:25
PB 369,78321-Aug-13 5:25 
GeneralRe: OT Pin
Pete O'Hanlon21-Aug-13 5:30
mvePete O'Hanlon21-Aug-13 5:30 
GeneralRe: At least he has repented Pin
thatraja21-Aug-13 5:28
professionalthatraja21-Aug-13 5:28 
GeneralRe: At least he has repented Pin
PB 369,78321-Aug-13 5:37
PB 369,78321-Aug-13 5:37 
GeneralSQL Error: The Horrors of Cut 'n Paste PinPopular
MehGerbil21-Aug-13 4:13
MehGerbil21-Aug-13 4:13 
I was working in Microsoft SQL Server Manager today.
I was creating a new stored procedure.

I cut pasted this:
SQL
SELECT * FROM tableName AS T1 ORDER BY T1.columnName DESC
into the the stored procedure template that looks like this:
SQL
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:	<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE <Procedure_Name, sysname, ProcedureName> 
	-- Add the parameters for the stored procedure here
	<@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>, 
	<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
END
GO

which created this:
SQL
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE <Procedure_Name, sysname, ProcedureName> 
	-- Add the parameters for the stored procedure here
	<@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>, 
	<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT * FROM tableName AS T1 ORDER BY T1.columnName DESCEND
GO


It took me a moment to find the problem because I kept thinking 'DESCEND' was a keyword.
Big Grin | :-D
GeneralRe: SQL Error: The Horrors of Cut 'n Paste Pin
vonb21-Aug-13 4:17
vonb21-Aug-13 4:17 
GeneralRe: SQL Error: The Horrors of Cut 'n Paste Pin
Mark_Wallace21-Aug-13 4:24
Mark_Wallace21-Aug-13 4:24 
GeneralRe: SQL Error: The Horrors of Cut 'n Paste Pin
vonb21-Aug-13 4:27
vonb21-Aug-13 4:27 
GeneralRe: SQL Error: The Horrors of Cut 'n Paste Pin
Corporal Agarn21-Aug-13 7:18
professionalCorporal Agarn21-Aug-13 7:18 
GeneralCat gets saved with dog's blood Pin
vonb21-Aug-13 4:08
vonb21-Aug-13 4:08 
GeneralRe: Cat gets saved with dog's blood Pin
Septimus Hedgehog21-Aug-13 4:20
Septimus Hedgehog21-Aug-13 4:20 
GeneralRe: Cat gets saved with dog's blood Pin
OriginalGriff21-Aug-13 4:23
mveOriginalGriff21-Aug-13 4:23 
GeneralRe: Cat gets saved with dog's blood Pin
MehGerbil21-Aug-13 4:24
MehGerbil21-Aug-13 4:24 
GeneralRe: Cat gets saved with dog's blood Pin
vonb21-Aug-13 4:27
vonb21-Aug-13 4:27 
GeneralRe: Cat gets saved with dog's blood Pin
Septimus Hedgehog21-Aug-13 5:24
Septimus Hedgehog21-Aug-13 5:24 
GeneralRe: Cat gets saved with dog's blood Pin
GrumbleDuke21-Aug-13 9:08
professionalGrumbleDuke21-Aug-13 9:08 
GeneralDoes your company do this? Pin
PB 369,78321-Aug-13 2:37
PB 369,78321-Aug-13 2:37 
GeneralRe: Does your company do this? Pin
Rage21-Aug-13 2:39
professionalRage21-Aug-13 2:39 
GeneralRe: Does your company do this? Pin
Pualee21-Aug-13 2:43
Pualee21-Aug-13 2:43 
JokeRe: Does your company do this? Pin
NotPolitcallyCorrect21-Aug-13 2:43
NotPolitcallyCorrect21-Aug-13 2:43 
GeneralRe: Does your company do this? Pin
MehGerbil21-Aug-13 2:44
MehGerbil21-Aug-13 2:44 
GeneralRe: Does your company do this? Pin
vonb21-Aug-13 2:45
vonb21-Aug-13 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.