How to ALTER multiple columns at once in SQL Server
I need to ALTER the data types of several columns in a table. For a single column, the following works fine: ALTER TABLE … Read more
I need to ALTER the data types of several columns in a table. For a single column, the following works fine: ALTER TABLE … Read more
I have a user-defined table type. I want to check it’s existence before editing in a patch using OBJECT_ID(name, type) function. What type … Read more
I am creating a stored procedure to do a search through a table. I have many different search fields, all of which are … Read more
I have a piece of dynamic SQL I need to execute, I then need to store the result into a variable. I know … Read more
In SQL, how can I remove the first 4 characters of values of a specific column in a table? Column name is Student … Read more
I am trying to execute this query: declare @tablename varchar(50) set @tablename=”test” select * from @tablename This produces the following error: Msg 1087, … Read more
I have a table and one of the columns is “Date” of type datetime. We decided to add a default constraint to that … Read more
This came up at the office today. I have no plans of doing such a thing, but theoretically could you write a compiler … Read more
I have a case where using a JOIN or an IN will give me the correct results… Which typically has better performance and … Read more
A few examples to show, just incase: Inline Table Valued CREATE FUNCTION MyNS.GetUnshippedOrders() RETURNS TABLE AS RETURN SELECT a.SaleId, a.CustomerID, b.Qty FROM Sales.Sales … Read more