Tag - SQL Server

How to check SQL Server database is exists using C#.NET

The following method using sys. schema and views such as sys.databases and sys.tables.As we know that the old style sysobjects and sysdatabases and those catalog views have been deprecated since SQL Server. private static bool CheckDatabaseExists(string connectionString, string databaseName) { string sqlQuery; bool result = false; try { ...

Prevent Saving Changes That Require Table Re-creation SQL Server

I was modifying an existing table using SQL Server Management Studio, but I got this error message on saving: Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option...

How to Dynamically Select rows in SQL Server

If you want to restrict other developers from using your Stored Procedures that returns a huge amount of data which affects server performance and Application Performance weather it is a Windows or Web Application. You can use the following idea when you create Stored Procedures: -- ============================================= -- Author: Amr...

XML Data and Document Storage in SQL Server

XML is a platform-independent data representation format based originally on SGML. Since its popularization, it is becoming used as a data storage format. It has its own type system, based on the XML Schema Definition language (XSD). Both XML and XSD are W3C standards at the Recommendation level. An XML schema defines the format...

SQL Server as a Runtime Host

If you are a SQL Server developer or database administrator, you might just be inclined to use the new Common Language Runtime (CLR) hosting feature to write stored procedures in C# or VB.NET without knowing how it works. But you should care. SQL Server is an enterprise application, perhaps one of the most important...

System Metadata Tables and INFORMATION_SCHEMA in SQL Server

Information about assemblies as well as the assembly code itself and the dependencies is stored in the system metadata tables, which, in general, store information about SQL Server database objects, such as tables and indexes. Some metadata tables store information for the entire database instance and exist only in the  MASTER database; some are...

SQL Injection

It is a way of hacking on a database driven application in which the hacker executes unauthorized SQL commands by taking advantage of insecure code on a system connected to the Internet, bypassing the firewall. SQL injection hackers are used to steal information from a database from which the data would normally not be available...