I have a column in a table named Foo called Bar. It's defined as a varchar(10) not null. The content of that column for the record I am looking at is Jan 1 1900 12:00AM -- remember, this is a varchar(10), not a datetime. But when I do a SQL query (in Query Analyzer) of something like SELECT Bar FROM Foo I get 1900-01-01 00:00:00.000 This means that SQL is somehow implictly converting the varchar to a datetime. This is becoming a problem because i have a query that uses the exact value of lots of columns to identify them, and when they're automatically being converted to datetimes, it screws everything up. What's going on here and how do I keep SQL Server (I think it's sql server!) from doing this implicit conversion to datetime?
SQL Server implicitly converting date-like VARCHAR to datetime
327 Views Asked by Gus Mueller At
0
There are 0 best solutions below
Related Questions in T-SQL
- Dynamic query creation with Array like implementation
- How to locate relevant tables or columns in a SQL Server database
- Calling a REST API from SQL Server
- How do I use Poor Man's T-SQL Formatter in SSMS v20?
- sp_executesql Not Working with a Parameters search nvarchar
- Using MSXML2.ServerXMLHTTP with SQL Server status, statusText and responseHeader are all null
- tsql functions like REPLACE() failing in azure data factory pipeline connected to salesforce
- GROUP BY with multiple nested queries T-SQL
- How to get the superset of all XML paths from an XML column in a table
- Split Invoice Total into multiple Rows but Split always equals Total
- Conversion failed when converting date and/or time from character string while ordering by date or string
- SQL How to add a conditional to the aggregate function within a pivot table?
- Update the column which has sequence number dynamically
- SQL query to extract incremental data from a table in SQL Server
- Convert Date format in a table
Related Questions in DATETIME
- I wrote this time displaying FLUTTER app, How can I improve it?
- How to convert pandas series to integer for use in datetime.fromisocalendar
- JSON file of 7000 meetings in multiple timezones and Flatlist
- Intl.DateTimeFormat() - return weekday as number?
- I'd like to create a custom time zone converter, any pointers?
- How set weekday datetime?
- ValueError: setting an array element with a sequence. Trying to make a Skymap in Python
- Different X axes with Plotly's make_subplots
- Error when converting datetime from UTC to Brasilia datetime in Power BI
- Problem converting time series df from chr to date using as.POSIXct
- How to supress naive datetime warning in django
- How to find rows that fall within time range from a dataframe?
- Timedelta error - AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'
- How to convert "Tue Feb 27 2024 16:35:30 GMT+0800" String to ZonedDateTime type
- react apex charts x axis labels and tool tip showing different times instead of actual PST time
Related Questions in CASTING
- Angular - type guard not narrowing types
- Functions to filter missing values in SQL and change them to null values
- Why is an empty string in JavaScript equals to zero?
- Casting Any to Integer returns a NullPointerException from the API
- Android kotlin casting warning
- Is there any way to cast bitmovin stream video on tv using DLNA service?
- bitmobin Streaming url video casting issue via DLNA service
- casting Rc<Self> of trait T to Rc<T> in rust
- Why did TypeScript not create immutable types to address array covariance & prevent variables from being indirectly assigned values of the wrong type?
- Check if object of base class came from subclass
- How to pass int2 parameter to a stored function?
- Error when casting System.Action using contravariance in C#
- Binary comparison of strings with SQL Server
- C# (WPF) Casting UIElement into an Type of class without knowing the type
- Pass cast ref-to-pointer from base to derived type
Related Questions in QUERY-ANALYZER
- Tips for Identifying Query Patterns and Creating REST Endpoints for a Database Wrapper Microservice
- How can I analyze Django ORM query performance on a server with DRF Endpoints only?
- Postgres query cost is higher but runs faster
- creating settings of index using elastic4s
- Elasticsearch Analyzer first 4 and last 4 characters
- How to Configure MySQL for Percona Monitoring and Management
- Elasticsearch auto look up query
- What does Level and State refer to in Microsoft SQL Server Query Analyzer
- SQL Server implicitly converting date-like VARCHAR to datetime
- Adding Where clause takes less time in SQL - why?
- SQL Server profiler trace not showing parameter values
- Custom analyzer, use case : zip-code [ElasticSearch]
- Can we use Google Translate API to index files for searching?
- What happens when the top-k query does not find enough documents to satisfy k constraint?
- How to stop Lucene Standard Analyzer removing special characters
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?