I am using SQL Server Management Studio v17.9.1. I have column in a database table that contains alphanumeric strings. I need to count the letters in the string and produce a table of the aggregate …
Tag: sql-server
Select * From Table Where column=data is not working [closed]
I am using SQL Server. The following query is working fine: select * from Users where Users.Id = 1 but when I use select * from Users where Users.Username = “User” this does not work. Error: …
ASynchronous Creation of Temp Tables in SQL Server
I’m currently trying to determine possible issues with creating temporary tables from a web application and how SQL Server naturally determines separate sessions. SELECT blabla, lala FROM table INTO #…
SqlException: invalid column name even though it’s not the column
I am trying to insert basic data into my MSSQL database but I keep receiving this error: System.Data.SqlClient.SqlException: ‘Invalid column name ‘Common’. Invalid column name ‘Bug’. Invalid column …
Get Sequence Current Value
I have a created sequence on my DB Server, used for generated registers and the detail of every one. I have to create a plain document of that detail in the moment of the generation, so I have to …
SQL Cross-Schema stored procedure permission issues
Given a simplified stored procedure CREATE OR ALTER PROCEDURE [FooSchema].[Foo] AS SELECT B.*, FROM [BarSchema].[Bar] AS B WHERE […] After granting EXEC to a user on the FooSchema, but …
SSIS data conversion issue of decimal
I have a dtsx package running in SSIS on our SQL server (2016 SP2 CU6), its a lightweight task of importing an Excel (xlsx) worksheet into a table in SQL as-is, no transformations needed at this stage, there is an agent job that does a lot more around it but I can see the fault is occurring in just this
Gaps And Islands: Splitting Islands Based On External Table
My scenario started off similar to a Island and Gaps problem, where I needed to find consecutive days of work. My current SQL query answers “ProductA was produced at LocationA from DateA through DateB,…
How to design entity tables for entities with multiple names
I want to create a table structure to store customers and I am facing a challenge: for each customer I can have multiple names, one being the primary one and the others being the alternative names. …
Adding new column to existing table with default value
Suppose I have a table called SerialNumbers which has columns: Id (int) SerialNumber (nvarchar) IsValid (bit) ToBeUsedBy (DateTime) Currently this table is being used by numerous different …