I know you can change the default value of an existing column like this: But according to this my query supposed to work: So here I’m trying to make my column Not Null and also set the Default value. But getting Incoorect Syntax Error near CONSTRAINT. Am I missing sth? Answer I think issue here is with …
Tag: sql-server
operation not allowed when the object is closed when running more advanced query
When I try to run a more advanced SQL query on an ASP page I get this error: operation not allowed when the object is closed When I run this code it’s working: But when I run this code (and this code is working if I run it in Microsoft SQL Server Management Studio), I get the error… This is
SQL Server range indexing ideas
I need help understanding how to create proper indexing on a table for fast range selects. I have a table with the following columns: Column — Type frameidx — int u — int v — int x — float(53) y — float(53) z — float(53) None of these columns is unique. There are to b…
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 fa…
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 workin…
There is insufficient system memory in resource pool ‘default’ to run this query. on sql
I have a running service that gets 50-100 queries per minute. And these are not high cost queries. This service has been running for around 3-4 months without any errors. Suddenly few days ago it started giving “There is insufficient system memory in resource pool ‘default’ to run this query…
The backend version is not supported to design database diagrams or tables
I’m trying to add a table to my newly created database through SQL Server Management Studio. However I get the error: the backend version is not supported to design database diagrams or tables To see my currently installed versions I clicked about in SSMS and this is what came up: What’s wrong her…
Split Full Name with Format: {Last, First Middle} Comprehensive Cases
My client sent me name data as a Name string which includes the last, first, and middle names in a single entry. I need them split into LastName, FirstName, and MiddleName. I have found some scripts online, but they don’t serve my purposes because they either (1) use a different format, or (2) don’…
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 group…
SQL Server query erroring with ‘An object or column name is missing or empty’
I have the following query in a stored procedure in SQL server: When the query is run I get the following error: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as “” or [] ar…