

xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propGetControlTitle>
<Shortcut>propGetControlShortcut>
<Description>Code snippet for propGetControlDescription>
<Author>Mike SneenAuthor>
<SnippetTypes>
<SnippetType>ExpansionSnippetType>
<SnippetType>SurroundsWithSnippetType>
SnippetTypes>
Header>
<Snippet>
<Declarations>
<Literal>
<ID>typeID>
<Default>LabelDefault>
Literal>
Declarations>
<Code Language="csharp">
public $type$ $end$$type$
{
get{ return $selected$; }
}]]>
Code>
Snippet>
CodeSnippet>
CodeSnippets>
1. Make an external tool definition
Tools... External Tools...
Add...
Title - 'Delete
App_Offline'
Command -
'cmd.exe'
Arguments - '/K "del
app_offline.htm'
Initial directory -
'$(ProjectDir)'
Use Output Window =
checked
2. put an entry on the toolbar to call it
Click on the down arrow of the toolbar... Add or
Remove Buttons... Customize
Categories - 'Tools'
Commands - External Tools 3
(Instead of 3, the 1 based index of your External Tool above)
Drag the command to the toolbar
Click on it and rename it
Declare @Search varchar(255)set @Search = 'IsThirdPartyProduct' --Set the search text hereDECLARE @SearchTxt varchar(255)SET @SearchTxt = '%' + @Search + '%'SELECT o.[name],
CASE
o.xtype
WHEN 'TR' THEN 'Trigger'
WHEN
'U' THEN 'User Table'
WHEN 'F' THEN 'Foreign Key'
WHEN 'C' THEN
'Check
Constraint'
WHEN 'UQ' THEN
'Index'
WHEN 'S' THEN 'System
Table'
WHEN 'D' THEN 'User Defined Data
Type'
WHEN 'PK' THEN 'Primary
Key'
WHEN 'FN' THEN 'Function'
WHEN 'TF' THEN
'Table Function'
WHEN 'V' THEN
'View'
WHEN 'P' THEN 'Stored
Procedure'
ELSE 'Other'
END
ObjType,
(SELECT TOP 1 SUBSTRING([Text],PATINDEX(@SearchTxt,
[Text]) - 25, 100) + '...'
FROM dbo.syscomments
WHERE [id] = c.[id]
AND
PATINDEX(@SearchTxt, [Text]) > 0) ObjText
FROM dbo.sysobjects
o
INNER JOIN dbo.syscomments c
ON o.[id] =
c.[id]
WHERE c.encrypted = 0
AND c.colid =
1
AND EXISTS( SELECT [id]
FROM dbo.syscomments
WHERE [text] LIKE
@SearchTxt
AND [id] =
c.[id])
ORDER BY ObjType, o.[name]
SELECT dbo.sysobjects.Name FROM dbo.syscolumnsINNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.IDWHERE dbo.syscolumns.Name = 'UserID' --and dbo.syscolumns.xtype = 175--AND dbo.sysobjects.type = 'U'
ALTER PROCEDURE [dbo].[usp_PracticeBillingAddress_Update]
(
@PracticeID INT
, @AddressID INT
, @AttentionOf VARCHAR(50)
, @AddressLine1 VARCHAR(50)
, @AddressLine2 VARCHAR(50)
, @City VARCHAR(50)
, @State CHAR(2)
, @ZipCode CHAR(5)
, @ZipCodePlus4 CHAR(4)
, @ModifiedUserID INT
)
AS
BEGIN
DECLARE @TransactionCountOnEntry INT -- Transaction Count before the transaction begins
, @Err INT -- holds the @@Error code returned by SQL Server
SELECT @Err = @@ERROR
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
IF @Err = 0
BEGIN
SELECT @TransactionCountOnEntry = @@TRANCOUNT
BEGIN TRANSACTION
END
IF @Err = 0
BEGIN
UPDATE dbo.Address
SET
AddressLine1 = @AddressLine1
, AddressLine2 = @AddressLine2
, City = @City
, State = @State
, ZipCode = @ZipCode
, ZipCodePlus4 = @ZipCodePlus4
, ModifiedUserID = @ModifiedUserID
, ModifiedDate = GETDATE()
WHERE
AddressID = @AddressID
SET @Err = @@ERROR
END
IF @Err = 0
BEGIN
UPDATE dbo.PracticeBillingAddress
SET
AttentionOf = @AttentionOf
, ModifiedUserID = @ModifiedUserID
, ModifiedDate = GETDATE()
WHERE
PracticeID = @PracticeID
AND AddressID = @AddressID
SET @Err = @@ERROR
END
Exec usp_PracticeBillingAddress_UpdateCentralDecentral @practiceID, @ModifiedUserID
IF @@TranCount > @TransactionCountOnEntry
BEGIN
IF @Err = 0
COMMIT TRANSACTION
ELSE
ROLLBACK TRANSACTION
-- Add any database logging here
END
RETURN @Err
END