Skip to main content
Tweeted twitter.com/#!/StackDBAs/status/528776074268655616
added 39 characters in body
Source Link
marc_s
  • 9k
  • 6
  • 45
  • 52

Is it possible to create or alter a stored procedure in SQL Server 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


 

I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sprocstored procedure when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sprocstored procedure already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.


 

Thanks to @marcelo for his answer, and it does appear that using the name of a non-existent table will allow you to create the sprocstored procedure.

However, it does not allow you to create a sprocstored procedure if you use a non-existent column in an existing table

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


 

I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sproc when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sproc already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.


 

Thanks to @marcelo for his answer, and it does appear that using the name of a non-existent table will allow you to create the sproc.

However, it does not allow you to create a sproc if you use a non-existent column in an existing table

Is it possible to create or alter a stored procedure in SQL Server 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.

I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the stored procedure when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the stored procedure already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.

Thanks to @marcelo for his answer, and it does appear that using the name of a non-existent table will allow you to create the stored procedure.

However, it does not allow you to create a stored procedure if you use a non-existent column in an existing table

added 253 characters in body
Source Link
freefaller
  • 217
  • 2
  • 4
  • 10

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sproc when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sproc already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.


Thanks to @marcelo for his answer, and it does appear that using the name of a non-existent table will allow you to create the sproc.

However, it does not allow you to create a sproc if you use a non-existent column in an existing table

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sproc when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sproc already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sproc when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sproc already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.


Thanks to @marcelo for his answer, and it does appear that using the name of a non-existent table will allow you to create the sproc.

However, it does not allow you to create a sproc if you use a non-existent column in an existing table

added 507 characters in body
Source Link
freefaller
  • 217
  • 2
  • 4
  • 10

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sproc when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sproc already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure?

(* - yes, unfortunately, we still need to support 2005 as our minimum standard)

I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.


I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the sproc when it's being altered/created.

Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using /* */ around the entire thing, as that will fail if there are any instances of /* */ in the sproc already.

I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.

Source Link
freefaller
  • 217
  • 2
  • 4
  • 10
Loading