|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 3:23 AM
Points: 9,367,
Visits: 6,464
|
|
|
|
|
|
Ten 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!
|
|
|
|
|
SSC-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
|
|
|
|
|
SSCommitted
      
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/
|
|
|
|
|
Mr 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.
|
|
|
|
|
Ten 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?
|
|
|
|
|
Hall 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”
|
|
|
|
|
SSC-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.
|
|
|
|
|
SSC-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.
|
|
|
|