Quantcast
Channel: Welcome To TechBrothersIT
Browsing all 1874 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

C# - How to remove last character from string in C#

Scenario: Download ScriptYou are working as C# or dot net developer, you are writing a program in which you need to remove last character from string values.There could be different scenariosLet's say...

View Article


Image may be NSFW.
Clik here to view.

C# - How to remove Extension from File Name in C#

Scenario : Download ScriptYou are working as C# or dot net developer, You need to read the file names from a folder and then remove the extension from file names.The file extensions can be of different...

View Article


Image may be NSFW.
Clik here to view.

C# - How to remove last X Characters from a string in C#

Scenario: Download ScriptYou are working as C# or dot net developer. You are writing a program in which you need to remove last x characters from a string.To make it more real time problem, think about...

View Article

Image may be NSFW.
Clik here to view.

C# - How to remove Character from String in C#

Scenario: Download ScriptYou are working as C# or dot net developer. You are writing a program in which you need to remove a character from string. Let's take real time example, you are reading file...

View Article

How to Create Table with Foreign Key Constraint in SQL Server - SQL Server /...

What is Foreign Key in SQL Server Table:Foreign Key in a table is a column or group of columns that provides a link between data in two tables. The Foreign Key in a table points to the primary key in...

View Article


Image may be NSFW.
Clik here to view.

How to create Foreign Key Constraint on Multiple Columns in SQL Server - SQL...

Scenario: You are working as SQL Server developer, you need to create a table dbo.Customer with composite primary key by using columns FName and SSN. One you are done with creating primary key in...

View Article

How to add Foreign key Constraint to existing table in SQL Server - SQL...

Scenario:You have already created two tables dbo.Customer and dbo.Orders. Primary Key is created on CustomerId column in dbo.Customer table.USE YourDatabaseNameGOCREATETABLE dbo.Customer ( Customerid...

View Article

The ALTER TABLE statement conflicted with the FOREIGN KEY constraint in SQL...

Scenario:You have created two tables dbo.Customer and dbo.Orders without having primary-foreign key relationship. After creating tables you inserted few records. Later you realized that you were...

View Article


Image may be NSFW.
Clik here to view.

Cannot truncate table because it is being referenced by a FOREIGN KEY...

Scenario: You need to truncate a table but when you try to execute truncate table tableName. You get below error.Msg 4712, Level 16, State 1, Line 43Cannot truncate table 'SchemaName.TableName' because...

View Article


Image may be NSFW.
Clik here to view.

How to get Parent Table, Reference Table, Foreign Key Constraint Name and...

Scenario:You are working as SQL Server Developer, you are asked to provide the query that should return all the parent tables, reference tables, Foreign Key Constraints and Columns used in Foreign Key...

View Article

Image may be NSFW.
Clik here to view.

How to drop Foreign Key Constraints in SQL Server Database for all the tables...

Scenario:You are working as SQL Server developer, you are asked to provide the scripts those can be used to drop Foreign Key Constraints on all the tables in a database if exists.Solution:We can use...

View Article

Image may be NSFW.
Clik here to view.

How to generate scripts to Re-Generate Foreign Key Constraints in SQL Server...

Scenario:You need to truncate all the tables in SQL Server database, when when you run truncate statement, you get error below error.Msg 4712, Level 16, State 1, Line 43Cannot truncate table...

View Article

Image may be NSFW.
Clik here to view.

Could not drop object because it is referenced by a FOREIGN KEY constraint -...

Scenario:You are working as SQL Server DBA or Developer, You need to drop a table from a database. When you execute drop table SchemaName.TableName statement, you get below error.Msg 3726, Level 16,...

View Article


Image may be NSFW.
Clik here to view.

How to Drop Foreign Key Constraint in SQL Server Database - SQL Server / TSQL...

Scenario:You are working as SQL Server developer and you need to prepare the script to drop the Foreign Key Constraint which was created on dbo.Orders table.Solution:Let's create dbo.Customer and...

View Article

Image may be NSFW.
Clik here to view.

The UPDATE statement conflicted with the REFERENCE constraint - SQL Server /...

Scenario:You are working as SQL Server developer, You wrote an update statement for one of the table and getting below error.Msg 547, Level 16, State 0, Line 32The UPDATE statement conflicted with the...

View Article


Image may be NSFW.
Clik here to view.

How to disable all Foreign Key Constraint in SQL Server Database - SQL Server...

Scenario: You are working as SQL Server developer, You need to provide the scripts to disable all the Foreign Key Constraint in SQL Server database.  This might be scenario where you need to load one...

View Article

Image may be NSFW.
Clik here to view.

How to Generate Script To Enable All Foreign Key Constraints in SQL Server...

Scenario: You are working as SQL Server developer, You need to prepare scripts to enable all the Foreign Key Constraint in a database which are disabled. This could happen, maybe somebody has disabled...

View Article


Image may be NSFW.
Clik here to view.

How to create Foreign Key Constraint With ON UPDATE CASCADE in SQL Server -...

Scenario:In previous posts, we learn that if we have Foreign key Constraint with default setting and we try to update the value in column in Reference Table which is used as Reference Column in Foreign...

View Article

Image may be NSFW.
Clik here to view.

How to create Foreign Key Constraint with ON DELETE CASCADE in SQL Server -...

Scenario:You are working as SQL Server developer, you need to create two tables with Primary -Foreign Key Relationship. You want to create Foreign Key Constraint with setting if record will be deleted...

View Article

Image may be NSFW.
Clik here to view.

How to Create Foreign Key Constraint with ON DELETE SET NULL Option in SQL...

Scenario:You are working as SQL Server developer, you need to create two tables with Primary -Foreign Key Relationship. You want to create Foreign Key Constraint with setting if record will be deleted...

View Article
Browsing all 1874 articles
Browse latest View live