C# içinde, satırdaki tek deyim olan ve use $(trop)
ifadesinin hemen önündeki tüm go
ifadelerini bulacağınız normal bir ifade yazmaya çalışıyorum.Açgözlü olmayan negatif görünüm
Oldukça yakınım - go
numaralı ifadelerin hepsini buluyor, ancak bunu doğru olarak elde edemiyorum - ilkinde ('Bunu yakalamak için' aşağıda işaretlenmiş şekilde bulundu), ama bilgi edemiyor Negatif gözünüzü düzgün bir şekilde çalışır hale getirin. Birisi bana yanlış yaptığım şeyle bana yardımcı olabilir mi?
set noexec off
:setvar trop devtip
:setvar trop_wf_tracking trop_workflow_tracking
:setvar trop_wf trop_wf
-- Information - to set this script to only run once change stop_if_applied to 1.
:setvar stop_if_applied 1
-- Do NOT catch this one
use $(trop)
go
if $(stop_if_applied) = 1 and exists (select * from $(trop).dbo.DATABASE_VERSION where DB_SCRIPT_NUMBER = 20656) begin
select 'This db script has already been run. If it is required to run again change the variable stop_if_applied to 0. Disabling all further commands on the connection.'
,* from $(trop).dbo.DATABASE_VERSION
where DB_SCRIPT_NUMBER = 20656
set noexec on
return
end
-- DO catch this one ----------
go
-- ------------------------------------------------------------------------------
set xact_abort on
begin transaction
select * from $(trop).dbo.DATABASE_VERSION where DB_SCRIPT_NUMBER = 20656;
/* Insert your code here */
select * from dbo.SECURITY_RIGHT
-- DO catch this one ----------
go
/* End of your code here */
-- DO catch this one ----------
go
if not exists (select * from $(trop).dbo.DATABASE_VERSION where DB_SCRIPT_NUMBER = 20656)
insert into $(trop).dbo.DATABASE_VERSION (DB_SCRIPT_NUMBER, COMMENT)
values (20656, 'comment goes here');
select * from $(trop).dbo.DATABASE_VERSION where DB_SCRIPT_NUMBER = 20656;
commit
Yok, bu SQL Server t-sql benziyor. Ayrıca, sorunuz normal ifadelerle ilgili ise, gönderiyi ihtiyacınız olan yardımı alma şansını artırmak için "regex" ile etiketlerdim. – gmiley
Ayrıca, konudaki dili belirtmeye gerek yoktur. Bunu kontrol etmelisiniz: http://stackoverflow.com/help/how-to-ask –
Çocuklar, bunun onun kodu olduğunu sanmıyorum. Sanırım bu ayrıştırmaya çalıştığı örnek. – Icemanind