I have a table in SQL SERVER “usage” that consists of 4 columns Now I need to query the table so that I can find how many users used an app under a license within a time frame. Bearing in mind that even if user 1 used the app on say january 1st and 2nd they would only count as
Tag: sql-server
SQL – Select records for the same day between particular data range [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Questions concerning problems with code you’ve written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance. Closed 8 years ag…
Unpivot with column name
I have a table StudentMarks with columns Name, Maths, Science, English. Data is like I want to get it arranged like the following: With unpivot I am able to get Name, Marks properly, but not able to get the column name in the source table to the Subject column in the desired result set. How can I achieve this…
SQL max product price [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself. Closed 8 years …
SQL Server: Invalid Column Name
I am working on modifying the existing SQL Server stored procedure. I added two new columns to the table and modified the stored procedure as well to select these two columns as well. Although the columns are available in the table, I keep getting this error: Invalid column name ‘INCL_GSTAMOUNT’ C…
C# SqlReader issue
I’am posting on this forum for the first time . and I really hope I can find some help . What I’am doing is load about … 1000 Value (example) from SQL and I’am doing it just fine . the query for example is : Select Value from DatabaseA.dbo.Values that “Value” ==> decimal…
Check users in a security group in SQL Server
In the Security/Users folder in my database, I have a bunch of security groups, include “MyApplication Users”. I need to check if I am (or another user is) in this group, but I have no idea how to query for it or where I could see this information. I tried looking in the properties, but couldnR…
Does an update statement in update trigger, fire trigger again?
If I use an update statement in an update trigger, does that update statement in update trigger causes fire trigger? Answer Make sure your database property for RECURSIVE_TRIGGERS is set to off (which is the default anyway) so that it cannot be fired recursively. http://technet.microsoft.com/en-us/library/ms1…
Combining (concatenating) date and time into a datetime
Using SQL Server 2008, this query works great: Gives me two columns like this: I’m trying to combine them into a single datetime using the plus sign, like this: I’ve looked on about ten web sites, including answers on this site (like this one), and they all seem to agree that the plus sign should …
How do I get constraints on a SQL Server table column
I have a column called MealType (VARCHAR) in my table with a CHECK constraint for {“Veg”, “NonVeg”, “Vegan”} That’ll take care of insertion. I’d like to display these options for selection, but I couldn’t figure out the SQL query to find out the constraint…