I have a linkedserver that will change. Some procedures call the linked server like this: [10.10.100.50].dbo.SPROCEDURE_EXAMPLE. We have triggers also doing this kind of work. We need to find...
This question already has answers here: Find a value anywhere in a database (19 answers) Closed 9 years ago. I have a specific value, let’s say string ‘comments’. I...
I need to ALTER the data types of several columns in a table. For a single column, the following works fine: ALTER TABLE tblcommodityOHLC ALTER COLUMN CC_CommodityContractID NUMERIC(18,0) But...
In SQL Server, I have a new column on a table: ALTER TABLE t_tableName ADD newColumn NOT NULL This fails because I specify NOT NULL without specifying a default...
What’s the difference between a Database and a Schema in SQL Server? Both are the containers of tables and data. If a Schema is deleted, then are all the...
I am using SQL Server 2005. I have a table with a text column and I have many rows in the table where the value of this column is...
I need to check if a specific login already exists on the SQL Server, and if it doesn’t, then I need to add it. I have found the following...
How could you remove all characters that are not alphabetic from a string? What about non-alphanumeric? Does this have to be a custom function or are there also more...
What are the advantages and disadvantages of using the nvarchar(max) vs. NText data types in SQL Server? I don’t need backward compatibility, so it is fine that nvarchar(max) isn’t...
I have a table and one of the columns is “Date” of type datetime. We decided to add a default constraint to that column Alter table TableName alter column...

