How to restrict the returned result set to 100 rows in TSQL?
Okay, so I have this query, with a case statement:
For some reason its repeating the value for the first case twice:
Case 1 - 23
Case 2 - 23
Case 1 - 23
I want to list all the orders whose amounts are greater than $500.00 and order them by date. Need help
I have below query :
SET A.LeaveStatusId = 'L0'
, LateInAfterTolerance = ?
, A.LateInWork = 1
I'm in middle designing a SQL dynamically by code and need a way to
1- Proper construct the SQL
2- To have it done in a clear manner
here is an extract of the statement.
Guys I have a problem with SqlConnection at this code and I cant find whats missing
so anyone help;
How would I grant create and alter table to a role in SQL Server 2005? The development team wish to use the Entity Framework in their application and this requires that role has the create and…
I have the 3 following Zip Codes in my file
Per the flat file spec's from my client, I have to return 9 characters and not use the hyphen that separates the Left 5 …
I need to read a Tablea, then add those records (10 varchar) into a existing SSRS report parameter (@Temp) before I process that parameter in the Stored Procedure. The parameter will already have ch…
I'm trying to create an aggregate table using the combination of two others.
Feed Table A:
Expected Result (Table B):
In record 1, 80 is the most recent record, 75 is the …
I need to display data in text field to update all information i need from the table.
when i tried to do it the error message " Column named id cannot be found.
Parameter name: columnName"
We have a current SQL query which summarizes the hours worked by a particular branches staff. Rather then running this report every month I would like to create a new report which automatically calcu…
I need some modification to the following posts answer.
I'm building a dynamic sql string and looking for the following.
Lets say there are two fields a text field (varchar 1000) and a date field.
Now I would like to filter for a date …
right now I have a procedure that we need to execute a script against a DB, then it will output a script, then we need to run that output script again the same DB,
in SQL job, what is the s…
CREATE TABLE #emp_records
Salary NUMERIC(8, 2)
INSERT INTO #emp_records
(Id, Name, Salary)
VALUES(1, 'A', 7000),
(2, 'B', 30000),
Lets say I have a variable called MySTR and has the following value 'A very long string, testing the string'
since the word string is duplicate I would like to eliminate it, and just g…
This article is very old, and while most of its principles are sound, PHP programming has changed a lot in the last decade. For that reason, I've updated this information in another art…
I am using Microsoft SQL Server 2005. I need to know the most recent date/time when each table was last opened. Is there a utility or query that can provide this information ?
I've got a Microsoft CRM database that I need to work with in order to prep for a data conversion to our new internal software.
However, this database is 40GB and it's problematic for me to get fre…
i am trying to create stored procedure but getting syntax error and dont know what am i doing wrong,
please assist me
i have execute this code
ALTER DATABASE ConfidentialDB
SET ENCRYPTION ON;
whats the mean?
i execute this select
SELECT * FROM ConfidentialDB.dbo.SecretKeys
i can vie…
I have a detail table with order information and I use a query with group by to rollup the details into summary lines by customer. The key here is that the SUB_GROUP_KEY is the
Hi, I have a Datawarehouse SQL job . Basically the job will populate our Datawarehouse overnight. one of the steps in the job will delete all the data in the datawarehouse overnight and reload
Full disclosure - I am very nearly a total SQL newbie.
I am trying to follow work instructions put together by our previous DBA to build a SQL 2012 server. I have the server in place and have follo…