I have a VARCHAR(MAX) field which is being interfaced to an external system in XML format. The following errors were thrown by the interface: mywebsite.com-2015-0202.xml:413005: parser error : …
Tag: tsql
MS SQL Server – How to create a view from a CTE?
The here above SQL is outputing like a charm all hours between two dates and a field retrieved from a join with another table: I would like to create a view from that but I do not manage to do it. I tried several things but without success. The following is returning : Incorrect syntax near the keyword ‘OPTION’. Answer
which gives best performance?
Please go through the following query, and help me to understand which one is efficient and how? In logical query execution, where clause will be executed after completion of join, so I thought the …
Join Two Non Related Tables
I have two tables Like A and B. Each have one column (ID) in ascending order. I want to join tables LIKE C Table. Datas are not statical but in A and B the row counts are always equal. I’ve tried join statements but couldn’t find out. Thanks for your help. Answer If you’re using a database that supports row_number()
Text was truncated or one or more characters had no match in the target code page including the primary key in an unpivot
I’m trying to import a flat file into an oledb target sql server database. here’s the field that’s giving me trouble: here are the properties of that flat file connection, specifically the field: here’s the error message: [Source – 18942979103_txt [424]] Error: Data conversion failed. The data conversion for column “recipient-name” returned status value 4 and status text “Text was
SQL Update if parameter is not null or empty
I searched some ways to check if a SQL Server parameter is not null or empty but I’m not sure what’s the best way to use this when updating several columns: I had this code at first that was updating without checking for empty or Null values: Then I added an IF clause before updating, it is working this way
Trying to get a single record involving MAX(Date) and GROUP
I am trying to create a query in which I start with an item number and a customer and I have to determine the last selling price. The tables involved are SOP30200 = Sales Header SOP30300 = Sales Detail lines Given the following code and results: CODE: RESULTS: I am getting 2 records because the query is grouped by UNITPRCE
Unable to start the Transact-SQL debugger, could not connect to the database engine instance
I have been trying to run debugging within SQl server management studio and for some reason the debugger has just stopped working. This is the message I get: Unable to start the Transact-SQL debugger,…
How to fill missing dates and values in partitioned data?
How to fill missing dates and values in partitioned data? I’m having a lot of trouble Googling this as most of the posts seem to feature Oracle databases, and I’m working with Microsoft SQL Server. I have the following hypothetical table: I want to fill in the dates in between the gaps and copy over the value from the most
Is there a T-SQL command that checks whether the object to which a synonym refers exists and is valid?
I’m trying to test if all synonyms on a database refer to valid objects, using the SQL batch script below, as part of a clean-up effort on our databases. This script just performs a query against the synonym, and printing out any errors it encounters. This works fine on views and tables, but not on sprocs. Is there’s an command