Introduction
Extension method is new to C#.Its allow you to add new method to the existing class.
Description
1.Extension method allows you to add new method to the existing class without modifying the code, recompiling or modifying the original code.
2.Extension method are special kind of static method but they are called using instance method syntax. Their first parameter specify which type the method operate on, and the parameter is precede by “this” modifier.
3.Extension method are only in scope when you explicitly import the namespace into your source code with “using” directive.
For Example in string object there is no method call “Reverse()” function .But if you need to extend the string ….
Sample Code
namespace ExtensionMethods
{
public static class ExtensionsClass
{
public static bool IsValidEmailAddress(this String EmailAddress)
{
Regex regex = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$");
return regex.IsMatch(EmailAddress);
}
}
}
How to Use?
string email = harish@company.com;
if ( email.IsValidEmailAddress() ) {
}
Note how the static method above has a "this" keyword before the first parameter argument of type string. This tells the compiler that this particular Extension Method should be added to objects of type "string".
for more information follow the Link
I am running this Blog to help other guys, who are looking some bits and pieces in terms of MS technology....
Monday, July 4, 2011
Wednesday, June 22, 2011
280 लाख करोड़ का सवाल है ..
280 लाख करोड़ का सवाल है ...
भारतीय गरीब है लेकिन भारत देश कभी गरीब नहीं रहा"* ये कहना है स्विस बैंक के
डाइरेक्टर का. स्विस बैंक के डाइरेक्टर ने यह
भी कहा है कि भारत का लगभग 280
लाख करोड़
रुपये उनके स्विस
बैंक में जमा है. ये रकम
इतनी है कि भारत का आने वाले 30 सालों का बजट
बिना टैक्स के
बनाया जा सकता
है.
या यूँ कहें कि 60 करोड़
रोजगार के अवसर
दिए जा सकते है. या यूँ भी कह सकते है
कि भारत के किसी भी गाँव से दिल्ली तक 4
लेन रोड बनाया
जा सकता है. ऐसा भी कह
सकते है कि 500 से ज्यादा सामाजिक प्रोजेक्ट पूर्ण किये जा सकते है. ये
रकम
इतनी ज्यादा है कि अगर हर भारतीय को 2000 रुपये हर महीने भी दिए जाये तो 60
साल तक ख़त्म ना हो. यानी भारत को किसी वर्ल्ड बैंक से लोन लेने कि कोई जरुरत
नहीं है. जरा सोचिये ... हमारे भ्रष्ट राजनेताओं
और नोकरशाहों ने
कैसे देश को
लूटा है और ये लूट का सिलसिला अभी तक 2011 तक जारी है.
इस सिलसिले को
अब रोकना
बहुत ज्यादा जरूरी हो गया है. अंग्रेजो ने हमारे भारत पर करीब 200 सालो तक राज
करके करीब 1 लाख
करोड़ रुपये लूटा. मगर आजादी के केवल 64 सालों में हमारे भ्रस्टाचार ने 280
लाख करोड़ लूटा है. एक तरफ 200 साल में 1 लाख करोड़ है और दूसरी तरफ केवल 64
सालों में 280 लाख करोड़ है. यानि हर साल लगभग 4.37लाख करोड़, या हर महीने
करीब 36 हजार करोड़ भारतीय मुद्रा स्विस बैंक में इन भ्रष्ट
लोगों द्वारा जमा
करवाई गई है. भारत को किसी वर्ल्ड बैंक के लोन की कोई दरकार नहीं है. सोचो की
कितना पैसा हमारे भ्रष्ट राजनेताओं और उच्च अधिकारीयों ने ब्लाक करके
रखा हुआ
है. हमे भ्रस्ट राजनेताओं और भ्रष्ट अधिकारीयों के खिलाफ जाने का पूर्ण अधिकार
है.हाल ही में हुवे घोटालों का
आप सभी को पता ही है - CWG घोटाला, २ जी
स्पेक्ट्रुम घोटाला , आदर्श होउसिंग घोटाला ... और ना जाने कौन कौन
से घोटाले
अभी उजागर होने वाले है ........आप लोग जोक्स फॉरवर्ड करते ही हो. इसे भी इतना
फॉरवर्ड करो की पूरा भारत
इसे पढ़े ... और एक आन्दोलन बन जाये
भारतीय गरीब है लेकिन भारत देश कभी गरीब नहीं रहा"* ये कहना है स्विस बैंक के
डाइरेक्टर का. स्विस बैंक के डाइरेक्टर ने यह
भी कहा है कि भारत का लगभग 280
लाख करोड़
रुपये उनके स्विस
बैंक में जमा है. ये रकम
इतनी है कि भारत का आने वाले 30 सालों का बजट
बिना टैक्स के
बनाया जा सकता
है.
या यूँ कहें कि 60 करोड़
रोजगार के अवसर
दिए जा सकते है. या यूँ भी कह सकते है
कि भारत के किसी भी गाँव से दिल्ली तक 4
लेन रोड बनाया
जा सकता है. ऐसा भी कह
सकते है कि 500 से ज्यादा सामाजिक प्रोजेक्ट पूर्ण किये जा सकते है. ये
रकम
इतनी ज्यादा है कि अगर हर भारतीय को 2000 रुपये हर महीने भी दिए जाये तो 60
साल तक ख़त्म ना हो. यानी भारत को किसी वर्ल्ड बैंक से लोन लेने कि कोई जरुरत
नहीं है. जरा सोचिये ... हमारे भ्रष्ट राजनेताओं
और नोकरशाहों ने
कैसे देश को
लूटा है और ये लूट का सिलसिला अभी तक 2011 तक जारी है.
इस सिलसिले को
अब रोकना
बहुत ज्यादा जरूरी हो गया है. अंग्रेजो ने हमारे भारत पर करीब 200 सालो तक राज
करके करीब 1 लाख
करोड़ रुपये लूटा. मगर आजादी के केवल 64 सालों में हमारे भ्रस्टाचार ने 280
लाख करोड़ लूटा है. एक तरफ 200 साल में 1 लाख करोड़ है और दूसरी तरफ केवल 64
सालों में 280 लाख करोड़ है. यानि हर साल लगभग 4.37लाख करोड़, या हर महीने
करीब 36 हजार करोड़ भारतीय मुद्रा स्विस बैंक में इन भ्रष्ट
लोगों द्वारा जमा
करवाई गई है. भारत को किसी वर्ल्ड बैंक के लोन की कोई दरकार नहीं है. सोचो की
कितना पैसा हमारे भ्रष्ट राजनेताओं और उच्च अधिकारीयों ने ब्लाक करके
रखा हुआ
है. हमे भ्रस्ट राजनेताओं और भ्रष्ट अधिकारीयों के खिलाफ जाने का पूर्ण अधिकार
है.हाल ही में हुवे घोटालों का
आप सभी को पता ही है - CWG घोटाला, २ जी
स्पेक्ट्रुम घोटाला , आदर्श होउसिंग घोटाला ... और ना जाने कौन कौन
से घोटाले
अभी उजागर होने वाले है ........आप लोग जोक्स फॉरवर्ड करते ही हो. इसे भी इतना
फॉरवर्ड करो की पूरा भारत
इसे पढ़े ... और एक आन्दोलन बन जाये
Thursday, June 2, 2011
How to search any specific string in a procedure, stored procedure and many other information.
If you need to find how many DB objects a person created and what is the created and modified date.
Please use the following sql statement for this:
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%search_string%'
AND ROUTINE_TYPE = 'PROCEDURE'
Please use the following sql statement for this:
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%search_string%'
AND ROUTINE_TYPE = 'PROCEDURE'
Friday, May 27, 2011
Hide Console Window in Console Application with C#
1) First write below code above your console main method:
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
2) Put below line of code in starting of main Method
// hide the console window
setConsoleWindowVisibility(false, Console.Title);
3) use below lie of code in your class
public static void setConsoleWindowVisibility(bool visible, string title)
{
//Sometimes System.Windows.Forms.Application.ExecutablePath works for the caption depending on the system you are running under.
IntPtr hWnd = FindWindow(null, title);
if (hWnd != IntPtr.Zero)
{
if (!visible)
//Hide the window
ShowWindow(hWnd, 0); // 0 = SW_HIDE
else
//Show window again
ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA
}
}
Finally you will see your console window hide.
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
2) Put below line of code in starting of main Method
// hide the console window
setConsoleWindowVisibility(false, Console.Title);
3) use below lie of code in your class
public static void setConsoleWindowVisibility(bool visible, string title)
{
//Sometimes System.Windows.Forms.Application.ExecutablePath works for the caption depending on the system you are running under.
IntPtr hWnd = FindWindow(null, title);
if (hWnd != IntPtr.Zero)
{
if (!visible)
//Hide the window
ShowWindow(hWnd, 0); // 0 = SW_HIDE
else
//Show window again
ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA
}
}
Finally you will see your console window hide.
Friday, May 20, 2011
Inserting duplicate records in Primary key field
One time I seen a duplicate entry in table primary key field,
that's strange for me or everyone, who don't know about this. But It's possible.
please follow the instructions:
1) let first us create a table:
create table testTable(
testempno number(9) primary key,
testename varchar2(50)
);
2) Insert some valid records into the table.
insert into testTablevalues(1,'test1');
insert into testTable values(2,'test2');
commit;
TESTEMPNO TESTENAME
1 test1
2 test2
3) Find out the constraint name for the primary key:
SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME LIKE 'testTable' ;
CONSTRAINT_NAME
SYS_C00111110
4) Disable the constraint:
ALTER TABLE testTable DISABLE CONSTRAINT SYS_C00111110;
5) Check whether the index for the field is enabled or not:
select index_name,index_type from user_indexes where table_name like 'testTable';
It should return no rows returned. If otherwise returned drop the index.
6) Now insert the duplicate record:
INSERT INTO testTable VALUES (1,'testDuplicate');
7) Now create a non-unique index on the field:
CREATE INDEX testTable_INDEX ON testTable(testempno);
8) And at final enable the primary key constraint:
ALTER TABLE testTable ENABLE NOVALIDATE CONSTRAINT SYS_C00111110;
Now give a select * from testTable;
TESTEMPNO TESTENAME
1 test1
2 test2
1 testDuplicate
9)Now you have a enabled primary key constraint with a violated data:
SELECT CONSTRAINT_NAME,STATUS FROM USER_CONSTRAINTS WHERE TABLE_NAME='testTable';
CONSTRAINT_NAME STATUS
SYS_C00111110 ENABLED
For More Info Click Here
that's strange for me or everyone, who don't know about this. But It's possible.
please follow the instructions:
1) let first us create a table:
create table testTable(
testempno number(9) primary key,
testename varchar2(50)
);
2) Insert some valid records into the table.
insert into testTablevalues(1,'test1');
insert into testTable values(2,'test2');
commit;
TESTEMPNO TESTENAME
1 test1
2 test2
3) Find out the constraint name for the primary key:
SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME LIKE 'testTable' ;
CONSTRAINT_NAME
SYS_C00111110
4) Disable the constraint:
ALTER TABLE testTable DISABLE CONSTRAINT SYS_C00111110;
5) Check whether the index for the field is enabled or not:
select index_name,index_type from user_indexes where table_name like 'testTable';
It should return no rows returned. If otherwise returned drop the index.
6) Now insert the duplicate record:
INSERT INTO testTable VALUES (1,'testDuplicate');
7) Now create a non-unique index on the field:
CREATE INDEX testTable_INDEX ON testTable(testempno);
8) And at final enable the primary key constraint:
ALTER TABLE testTable ENABLE NOVALIDATE CONSTRAINT SYS_C00111110;
Now give a select * from testTable;
TESTEMPNO TESTENAME
1 test1
2 test2
1 testDuplicate
9)Now you have a enabled primary key constraint with a violated data:
SELECT CONSTRAINT_NAME,STATUS FROM USER_CONSTRAINTS WHERE TABLE_NAME='testTable';
CONSTRAINT_NAME STATUS
SYS_C00111110 ENABLED
For More Info Click Here
Friday, April 29, 2011
Undo changes in Team Foundation Server(TFS) and "Undo Pending Changes..." for users no longer with the company
How do you undo a change for a person who is no longer with the company?
In two steps you can perform this task.
1) Open Command Prompt and select an specified path
C:\Program Files\Microsoft SQL Server\90\NotificationServices\9.0.242\Bin>cd C:\
Program Files\Microsoft Visual Studio 9.0\Common7\IDE
2) Give a proper file path with tf command
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>tf undo /workspace:WorkSpace Name;tfs User name $/file path /s:http://172.0.1.1:port
finally you will get a successful message as below.
The operation completed successfully.
In two steps you can perform this task.
1) Open Command Prompt and select an specified path
C:\Program Files\Microsoft SQL Server\90\NotificationServices\9.0.242\Bin>cd C:\
Program Files\Microsoft Visual Studio 9.0\Common7\IDE
2) Give a proper file path with tf command
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>tf undo /workspace:WorkSpace Name;tfs User name $/file path /s:http://172.0.1.1:port
finally you will get a successful message as below.
The operation completed successfully.
Wednesday, April 6, 2011
Using INSERT / OUTPUT in a SQL Server Transaction
Frequently I find myself in situations where I need to insert records into a table in a set-based operation wrapped inside of a transaction where secondarily, and within the same transaction, I spawn-off subsequent inserts into related tables where I need to pass-in key values that were the outcome of the initial INSERT command. Thanks to a Transact/SQL enhancement in SQL Server, this just became much easier and can be done in a single statement... WITHOUT A TRIGGER!
Solution
One of the Transact/SQL enhancements in Microsoft SQL Server is the OUTPUT sub-clause of the INSERT statement. You can now capture the records inserted via an INSERT statement (think also being able to capture IDENTITY column values for the new rows) for subsequent use in an additional INSERT statement for a child table to persist referential integrity without the need for an INSERT trigger.
Why not just use a trigger? It's a viable and proven construct of SQL Server, right?
The short answer is "Yes, it is." However, triggers are one of those nasty little secrets that the database keeps. They don't just jump right out at you and say "HERE I AM!" Take for example the troubleshooting process of deadlocks or tuning a poorly-performing query - a trigger sitting in the background performing as it's been asked to may be causing your issues, but you're going to go through many iterations of searching stored procedures, and ad-hoc T/SQL code before you probably even stop to consider there is a trigger firing off data modification language commands (DML) - INSERTS, UPDATES, or DELETES that are adjunct to what you're trying to diagnose. I associate the use of triggers with the use of ad-hoc T/SQL code used in an application's code stack and passed to a SQL Server instance for processing - practices to shy away from.
That is why I like what I see with the INSERT-OUTPUT construct. You get the benefits of being able to capture the inserted values that you can then pass to a secondary command - and you can wrap this all inside a single transaction for atomicity. The syntax for this construct is shown below and differs only slightly from the basic INSERT T/SQL command:
INSERT INTO
(
)
OUTPUT INSERTED. --and other columns from SOME_TABLE if need be
INTO
(
)
SELECT
(
)
FROM
WHERE
The only difference between this and a standard INSERT statement is the inclusion on the OUTPUT...INTO statement. To make this easy think of it as simply a secondary INSERT statement inside of the original INSERT statement that captures the values in the virtualized INSERTED table - the same table that a trigger would use - to process a secondary INSERT to another table. In the example below, and in keeping with the holiday season, let's say you're responsible for doing a bit of hiring at the corporate AdventureWorks offices. A right-jolly old elf is being hired for some in-store promotions and in keeping with corporate policy you always perform a 90 day review for any new hires. We want to have the notfication recorded when the new hire is entered without any additional work on the part of Human Resources. The code below demonstates how we can use INSERT-OUTPUT to do this.
USE AdventureWorks;
GO
---Create Example Tables
/*
Note, this is not fully-normalized. I would have included another table
for Notification Types if this was an actual solution.
I would also use an int NotificationTypeID column in Notifications table
instead of a varchar(xx) NotificationType column.
*/
CREATE SCHEMA [HR] AUTHORIZATION dbo;
GO
CREATE TABLE [HR].[Staff]
(
[StaffID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] VARCHAR(30) NOT NULL,
[LastName] VARCHAR(30) NOT NULL,
CONSTRAINT [PK_StaffID] PRIMARY KEY CLUSTERED
(
[StaffID] ASC
)ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [HR].[Notification]
(
[NotificationID] [int] IDENTITY(1,1) NOT NULL,
[StaffID] [int] NOT NULL,
[NotificationDate] DATETIME NOT NULL,
[NotificationType] VARCHAR(30) NOT NULL,
CONSTRAINT [PK_NotificationID] PRIMARY KEY CLUSTERED
(
[NotificationID] ASC
)ON [PRIMARY]
) ON [PRIMARY]; Now that we've built the objects for this little exercise we can look at the INSERT-OUTPUT construct in action...
/*
Demonstrate how you can insert the key values added to Staff.StaffID
into Notifications.StaffID in single transaction
*/
INSERT INTO HR.Staff ( FirstName, LastName )
OUTPUT INSERTED.StaffID, DATEADD(d,90,GETDATE()),'90-Day Review'
INTO HR.Notification
(
StaffID,
NotificationDate,
NotificationType
)
VALUES ( 'Santa','Claus'); Selecting now from both the Staff and Notification tables you'll see that the key values were successfully entered into both tables:
SELECT * FROM HR.Staff;
SELECT * FROM HR.Notification;
Now there is a very important - and quite limiting caveat to using INSERT-OUTPUT. The Output target can't be part of any foreign key relationship. Even if there is no cascading relationship to any other object via that relationship in the database. Let's look at what happens if it is. We'll add a foreign key to Notification on StaffID, referencing the StaffID column in the Staff table and then try to add some additional holiday help:
--Add Foreign Key for StaffID column to Notifications table
ALTER TABLE HR.Notification ADD CONSTRAINT [FK_Notification_Staff]
FOREIGN KEY
(
StaffID
)
REFERENCES HR.Staff
(
StaffID
);
/*
Demonstrate how you can insert the key values added to Staff.StaffID
into Notifications.StaffID in single transaction
*/
INSERT INTO HR.Staff ( FirstName, LastName )
OUTPUT INSERTED.StaffID, DATEADD(d,90,GETDATE()),'90-Day Review'
INTO HR.Notification
(
StaffID,
NotificationDate,
NotificationType
)
VALUES ( 'Frosty','Snowman');
SELECT * FROM HR.Staff;
SELECT * FROM HR.Notification;
The following error message is returned as expected:
Msg 332, LEVEL 16, State 1, Line 17
The target TABLE 'HR.Notification' OF the OUTPUT INTO clause cannot be ON either side OF a (PRIMARY KEY, FOREIGN KEY) relationship. Found reference CONSTRAINT 'FK_Notification_Staff'.
For More Information please visit http://www.mssqltips.com/tip.asp?tip=2183
Solution
One of the Transact/SQL enhancements in Microsoft SQL Server is the OUTPUT sub-clause of the INSERT statement. You can now capture the records inserted via an INSERT statement (think also being able to capture IDENTITY column values for the new rows) for subsequent use in an additional INSERT statement for a child table to persist referential integrity without the need for an INSERT trigger.
Why not just use a trigger? It's a viable and proven construct of SQL Server, right?
The short answer is "Yes, it is." However, triggers are one of those nasty little secrets that the database keeps. They don't just jump right out at you and say "HERE I AM!" Take for example the troubleshooting process of deadlocks or tuning a poorly-performing query - a trigger sitting in the background performing as it's been asked to may be causing your issues, but you're going to go through many iterations of searching stored procedures, and ad-hoc T/SQL code before you probably even stop to consider there is a trigger firing off data modification language commands (DML) - INSERTS, UPDATES, or DELETES that are adjunct to what you're trying to diagnose. I associate the use of triggers with the use of ad-hoc T/SQL code used in an application's code stack and passed to a SQL Server instance for processing - practices to shy away from.
That is why I like what I see with the INSERT-OUTPUT construct. You get the benefits of being able to capture the inserted values that you can then pass to a secondary command - and you can wrap this all inside a single transaction for atomicity. The syntax for this construct is shown below and differs only slightly from the basic INSERT T/SQL command:
INSERT INTO
(
)
OUTPUT INSERTED.
INTO
(
)
SELECT
(
)
FROM
WHERE
The only difference between this and a standard INSERT statement is the inclusion on the OUTPUT...INTO statement. To make this easy think of it as simply a secondary INSERT statement inside of the original INSERT statement that captures the values in the virtualized INSERTED table - the same table that a trigger would use - to process a secondary INSERT to another table. In the example below, and in keeping with the holiday season, let's say you're responsible for doing a bit of hiring at the corporate AdventureWorks offices. A right-jolly old elf is being hired for some in-store promotions and in keeping with corporate policy you always perform a 90 day review for any new hires. We want to have the notfication recorded when the new hire is entered without any additional work on the part of Human Resources. The code below demonstates how we can use INSERT-OUTPUT to do this.
USE AdventureWorks;
GO
---Create Example Tables
/*
Note, this is not fully-normalized. I would have included another table
for Notification Types if this was an actual solution.
I would also use an int NotificationTypeID column in Notifications table
instead of a varchar(xx) NotificationType column.
*/
CREATE SCHEMA [HR] AUTHORIZATION dbo;
GO
CREATE TABLE [HR].[Staff]
(
[StaffID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] VARCHAR(30) NOT NULL,
[LastName] VARCHAR(30) NOT NULL,
CONSTRAINT [PK_StaffID] PRIMARY KEY CLUSTERED
(
[StaffID] ASC
)ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [HR].[Notification]
(
[NotificationID] [int] IDENTITY(1,1) NOT NULL,
[StaffID] [int] NOT NULL,
[NotificationDate] DATETIME NOT NULL,
[NotificationType] VARCHAR(30) NOT NULL,
CONSTRAINT [PK_NotificationID] PRIMARY KEY CLUSTERED
(
[NotificationID] ASC
)ON [PRIMARY]
) ON [PRIMARY]; Now that we've built the objects for this little exercise we can look at the INSERT-OUTPUT construct in action...
/*
Demonstrate how you can insert the key values added to Staff.StaffID
into Notifications.StaffID in single transaction
*/
INSERT INTO HR.Staff ( FirstName, LastName )
OUTPUT INSERTED.StaffID, DATEADD(d,90,GETDATE()),'90-Day Review'
INTO HR.Notification
(
StaffID,
NotificationDate,
NotificationType
)
VALUES ( 'Santa','Claus'); Selecting now from both the Staff and Notification tables you'll see that the key values were successfully entered into both tables:
SELECT * FROM HR.Staff;
SELECT * FROM HR.Notification;
Now there is a very important - and quite limiting caveat to using INSERT-OUTPUT. The Output target can't be part of any foreign key relationship. Even if there is no cascading relationship to any other object via that relationship in the database. Let's look at what happens if it is. We'll add a foreign key to Notification on StaffID, referencing the StaffID column in the Staff table and then try to add some additional holiday help:
--Add Foreign Key for StaffID column to Notifications table
ALTER TABLE HR.Notification ADD CONSTRAINT [FK_Notification_Staff]
FOREIGN KEY
(
StaffID
)
REFERENCES HR.Staff
(
StaffID
);
/*
Demonstrate how you can insert the key values added to Staff.StaffID
into Notifications.StaffID in single transaction
*/
INSERT INTO HR.Staff ( FirstName, LastName )
OUTPUT INSERTED.StaffID, DATEADD(d,90,GETDATE()),'90-Day Review'
INTO HR.Notification
(
StaffID,
NotificationDate,
NotificationType
)
VALUES ( 'Frosty','Snowman');
SELECT * FROM HR.Staff;
SELECT * FROM HR.Notification;
The following error message is returned as expected:
Msg 332, LEVEL 16, State 1, Line 17
The target TABLE 'HR.Notification' OF the OUTPUT INTO clause cannot be ON either side OF a (PRIMARY KEY, FOREIGN KEY) relationship. Found reference CONSTRAINT 'FK_Notification_Staff'.
For More Information please visit http://www.mssqltips.com/tip.asp?tip=2183
Subscribe to:
Posts (Atom)
Split the String values with a special character in MS Flow to convert this into Array
Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...
-
Sometimes you experienced when you have subgrid in your CRM Form, but when you click the ‘expand’ button to expand the view then it will re...
-
I have a web service that takes a serialize string and saves it. This works fine for "small" files, but once I hit a large siz...
-
In CRM 2011, I found a way to add color to entities grids using the ribbon, even if there are still two limitations: 1) This is still no...