I have two different blocks of sql code which basically perform the same functionality. One queries SYS.COLUMNS and the other queries
Which query is better to use, #1 or #2 ? Also ignore the fact that the second query uses parameters for the table name and column name instead of the hard coding which occurs in #1.
IF NOT EXISTS (SELECT * FROM sys.columns WHERE Name = N'ROTOCOST' AND Object_ID = Object_ID())
EXEC('ALTER TABLE CUSTOMERS ADD ROTOCOST CHAR(9)')
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = @NewColName AND TABLE_NAME = @TableName)
SET @sql = 'ALTER TABLE ' + @TableName + ' ADD ' + @NewColName + ' ' + ' CHAR(9) '
INFORAMTION_SCHEMA is an ANSI standard. Theoretically when you use it it should work for any RDBMS types. However, also because of this it has an extra overhead. The ANSI standard may require to include
With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.