Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Parameters Expand / Collapse
Author
Message
Posted Friday, November 04, 2011 12:31 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:23 AM
Points: 9,367, Visits: 6,464
Nice question, thanks.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1200392
Posted Friday, November 04, 2011 4:07 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, May 02, 2013 10:51 AM
Points: 1,219, Visits: 13,507
good question! thanks!


rfr.ferrari
DBA - SQL Server 2008
MCITP | MCTS

remember is live or suffer twice!
Post #1200459
Posted Friday, November 04, 2011 11:46 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 5:15 AM
Points: 107, Visits: 186
I knew this and thats what I focused on too.
The other errors you can choose occurs further down in the code, so I choosed the ',' error.

Regards Marten
Post #1200804
Posted Monday, November 07, 2011 5:36 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, October 24, 2012 8:17 PM
Points: 1,558, Visits: 247
Good question regardless of the minor errors. Thanks.

http://brittcluff.blogspot.com/
Post #1201328
Posted Monday, November 07, 2011 8:17 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 7:24 AM
Points: 563, Visits: 58,878
As everyone has stated already this should have started by saying in SQL 2008 or higher. In SQL 2005 there is no correct answer.
Post #1201459
Posted Friday, November 11, 2011 8:39 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, May 15, 2013 1:00 PM
Points: 1,349, Visits: 1,737
Thank you for an interesting question.

I liked the parameters with the dynamic t-sql string, so I thought I'd try it out. I don't work with linked servers, but I was interested to see if I could use this parameter syntax. No, I got a syntax error. Looking at the BOL syntax, it looked to me as if the [ AT linked_server_name ] was optional, but apparently not?
Post #1204216
Posted Tuesday, November 15, 2011 6:41 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 3:48 AM
Points: 3,125, Visits: 4,311
Carla Wilson-484785 (11/11/2011)
Thank you for an interesting question.

I liked the parameters with the dynamic t-sql string, so I thought I'd try it out. I don't work with linked servers, but I was interested to see if I could use this parameter syntax. No, I got a syntax error. Looking at the BOL syntax, it looked to me as if the [ AT linked_server_name ] was optional, but apparently not?

The "AT linked server" is optional, however, for a local query one would not likely use dynamic SQL with parameters to populate a variable, as it can be done directly ,e.g.
SELECT @Var1 = ColumnA FROM Table WHERE ColumnX = @Var2

The use of placehoders was designed explicitly for remote execution, to eliminate the need to build strings, converting variables to varchar etc.
It does appear to make the code more readable as well...


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1205919
Posted Tuesday, November 29, 2011 3:50 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 13, 2012 12:23 PM
Points: 163, Visits: 41
In Sql Server 2005 you cann´t set a variable like this:

@x varchar(10) = '12345'

Only works in Sql 2008.
Post #1213599
Posted Friday, March 02, 2012 3:56 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, May 17, 2013 1:06 PM
Points: 469, Visits: 192
Great learning process on Linked Servers executions.

Thank you.
Post #1261075
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse