MS SQL compare dates?
Should do what you need. Test Case Returns
Should do what you need. Test Case Returns
coalesce is supported in both Oracle and SQL Server and serves essentially the same function as nvl and isnull. (There are some important differences, coalesce can take an arbitrary number of arguments, and returns the first non-null one. The return type for isnull matches the type of the first argument, that is not true for coalesce, at least on SQL Server.)
Try to use ISNUMERIC to handle strings which can’t be converted:
I have a SQL Server database and I want to know what columns and types it has. I’d prefer to do this through a query rather than using a GUI like Enterprise Manager. Is there a way to do this?
I believe this may be what your looking for: or I haven’t tested the syntax on the 2nd example. I’m not sure if that works 100% – it may require some tweaking – but it conveys the general idea of how to obtain your desired output. EDIT To address concerns listed in the comments… @pkr298 … Read more
There are many tutorial articles about xml parsing with TSQL. For example, http://www.sqlserver.info/syntax/parse-xml-with-sql-server/
You will need to post the table definitions for the source and destination tables for us to figure out where the issue is but the bottom line is that one of your columns in the source table is bigger than your destination columns. It could be that you are changing formats in a way you were … Read more
Limiting the size of the varchar chops of the hour portion that you don’t want.
There is no combination of LIKE & IN in SQL, much less in TSQL (SQL Server) or PLSQL (Oracle). Part of the reason for that is because Full Text Search (FTS) is the recommended alternative. Both Oracle and SQL Server FTS implementations support the CONTAINS keyword, but the syntax is still slightly different: Oracle: SQL … Read more
You can obtain this information and much, much more by querying the Information Schema views. This sample query: Can be made over all these DB objects: CHECK_CONSTRAINTS COLUMN_DOMAIN_USAGE COLUMN_PRIVILEGES COLUMNS CONSTRAINT_COLUMN_USAGE CONSTRAINT_TABLE_USAGE DOMAIN_CONSTRAINTS DOMAINS KEY_COLUMN_USAGE PARAMETERS REFERENTIAL_CONSTRAINTS ROUTINES ROUTINE_COLUMNS SCHEMATA TABLE_CONSTRAINTS TABLE_PRIVILEGES TABLES VIEW_COLUMN_USAGE VIEW_TABLE_USAGE VIEWS