Can I get the names of all the tables of a SQL Server database in a C# application?
It is as simple as this: DataTable t = _conn.GetSchema(“Tables”); where _conn is a SqlConnection object that has already been connected to the correct database.
It is as simple as this: DataTable t = _conn.GetSchema(“Tables”); where _conn is a SqlConnection object that has already been connected to the correct database.
You could use the ‘CASE .. WHEN .. THEN .. ELSE .. END’ syntax in SQL.
Question: Is it possible to setup a notification email being sent to multiple operators for that specific job? I don’t believe this is possible. Certainly looking at the structure of [msdb].[dbo].[sysjobs] the various operator_id columns are in this table itself which would support the idea that 1 to many is not possible. But some alternatives … Read more
Here is another solution which only works in Sql Server 2005 and newer because it uses the except statement. But I share it anyway. If you want to get the records 50 – 75 write: select * from ( SELECT top 75 COL1, COL2 FROM MYTABLE order by COL3 ) as foo except select * … Read more
From the MSDN Documentation: “Before you call Prepare, specify the data type of each parameter in the statement to be prepared. For each parameter that has a variable length data type, you must set the Size property to the maximum size needed. Prepare returns an error if these conditions are not met. If you call … Read more
If I recall correctly, it should be something like: ALTER TABLE table_name ADD extra REAL DEFAULT 0 See: http://msdn.microsoft.com/en-us/library/ms190273.aspx See: Add a column with a default value to an existing table in SQL Server
yes it does. See this
There are several ways, but I think the following is the most popular: select allk.k, t1.c1, t2.v2, t3.v3, t4.v4 from (select k from t1 union select k from t2 union select k from t3 union select k from t4 ) allk left outer join t1 on allk.k = t1.k left outer join t2 on allk.k … Read more