Hey guys I am using a connection string database set-up inside visual studios 2012. I am trying to send data to the database there are no errors in the code but its not running, any help would be fantastic as i have been at it for a few hours now and need some sleep. Thanks. […]
I am trying to clone a database record in the entity framework, but I am wondering how to account for ID fields in the object graph that are GUIDS which are not generated by SQL server. I have tried a method I found here on stack overflow but the ID’s were integers and didn’t fit […]
Is there a default report in Sql Server that will output the permissions/securables history for given user or login? If not, does anyone know how to craft such a query? We had an incident recently where a user mysteriously lost insert permissions on a table, and we’d like to find out exactly what caused it.
I have three tables (simplified table diagram above). From these three tables I would like to create a view that would be the combination of TableA and TableB (all rows from tableA and all from TableB with no duplicates). The catch is I don’t want the foriegn keys from TableA but instead I want the […]
I develop a software system that runs on multiple computers that connect to a centralized database. At this point in time, all SQL queries are inline with the applications source code. I would like to start migrating these into stored procedures. If I need to make a change to a stored procedure that will require […]
There is a SQL statement, generated by stored procedure, looking like this: SELECT Id, Name FROM UInstitutions as UI WHERE Contains(UI.Name, @ParamName) It seems that if value has dot (.) as second or third symbol, it’s unsearchable, when searching by exact match or substring. E.g.: [dbo].[FindRecords] N’b.la bla’ or [dbo].[FindRecords] N’bl.a bla’ return nothing, while […]
In essence, I’d like the ability to create a scalar function which accepts a variable number of parameters and concatenates them together to return a single VARCHAR. In other words, I want the ability to create a fold over an uncertain number of variables and return the result of the fold as a VARCHAR, similar […]
I’m having column as Node varchar(25) in MS-SQL Server. The possible values are node —– D-C C-B B-A B-C B-E C-A A-B A-C C-D etc. I want to retrieve the the distinct combinations from it. E.g.: node —- D-C C-B B-A B-E C-A Please tell the SQL for this.
Anyone know of an easy way to label rows with a literal label ie 1 | first | data 2 | second| data 3 | third | data 4 | fourth| data 5 | fifth | data Other then using a conditional ordinal. Thanks
I have a data file that has many duplicate values. I want both the original and the duplicate values to be identified and original and duplicate values to be ordered side by side. My Data files headings are like this along with the data: I want the data to be like this: I have already […]