Based on below 2 tables
declare @t1 table
(
Id int,
Title varchar(100),
RelatedId int
)
insert into @t1 values(1,'A',2)
insert into @t1 values(1,'A',3)
declare @t2 table
(
Id int,
Title varchar(100)
)
insert into @t2 values
(2,'B'),
(3,'C')
I am trying to get the below output
Id Title RelatedItems
-------...
Query:
;WITH SuperSelect AS (
SELECT DISTINCT
DropshipPackinglist.CaseNumber AS 'CASE NO.',
DropshipPackinglist.Quantity AS 'QTY'
FROM DropshipPackinglist
JOIN HuaweiDescription ON DropshipPackinglist.ItemNumber = HuaweiDescription.ItemNumber
WHERE (DropshipPackinglist.BatchCode ='0003721008190AHWA01KG'))
SELE...
I run Visual C++ Windows Forms application and MS SQL server 2005. I succeeded to connect to server and view table contents (tools -> connect to database), but when I try to add new datasource, nothing is found by wizard. Why?
...
Could you please suggest - programming option?
Our Web application could have 60000 database requests/second or more in future.
Which is better: MS-SQL or MySQL or other?
Which is better: Asp.net, PHP, JSP or other?
What kind of webhosting is reliable for auto-scaling?
Any good webhosters or hosting plans?
Thanks a lot.
...
Given a multi-tenant setup with one database that holds the tenant data, and one database for each tenant, how can you construct a query to look up the same piece of data in each tenant database?
eg The tenant master database has a table called Tenants:
[TenantMaster].[dbo].[Tenants]
Id, Name, DatabaseName
1, Bob, bobs_db_name
2, Kate,...
Hi
I'm running into trouble with Query Notifications on SQL Server 2008 sp1. I have a table _sys_Events that multiple writers write entries into, and multiple readers perform SELECT statements with Query Notification to get latest entries immediately (this is done through .Net System.Data.SqlClient.SqlDependency class). Our database is ...
Hi,
I had a win7 x64 box with a local Sharepoint 2010 installed on an SQLEXPRESS DB.
Last week I also installed an SQL 2008 R2 instance with integration and analysis services next to the existing database.
Because I had issues deploying analysis services solutions, I messed around quite some with the SQL Services Accounts. Eventually...
We have a database with a lot of information about Persons. I won't post the entire database structure because it is too big, but it looks something like this:
Person
ID
Name
Street
City
State
Country
Language
LangCode
Language
Interest
ID
LastChangedBy
LastChangedOn
LocalizedInterest
InterestID
LangCode
Description
PersonInterest...
I realise what I'm asking for may be impossible. I want to perform an UPDATE on two separate tables based on a LEFT JOIN and a WHERE clause. This is my attempt:
UPDATE PERIODDATES as pd, periods2 as p2
SET pd.[PERIODCODE] = @PERIODCODE,
p2.[USERCODE] = @USERCODE
left join periods2 AS p2
ON pdates.schemeid =...
I have a stored procedure that gives a friendly enough error that I want to show to the users but when I call it from .net it comes out twice. When I call the proc from sql server management studio it only comes out once.
Here is a cutdown version of the stored proc:
ALTER PROC [Production].[spDoSomething] (
@PassedID int)
...
I need to get the current 2 digit year and increment by one. So the current number I'm looking for should be 11.
Probably really simple but I'm a sql noob :)
Thanks
...
Hi,
Is there a way to geocode a table of addresses so that latitude and longitude columns can be updated with the correct details.
Ideally I would like a system that will operate every so often, geocoding any address that did not have a lat / long.
Currently there are areound 30,000 addresses in said table.
Thanks in advance
Edit
Th...
Exact duplicate of The EXECUTE permission was denied on the object
'zzzzzz, database 'xxxxxx' schema
'yyyyyy',
I'm having problems executing a function...
Here's what I did:
create a function using sql server management studio. it was successfully created.
i then tried executing the newly created function and here's what I...
I'm having problems executing a function...
Here's what I did:
create a function using SQL Server Management Studio. It was successfully created.
I then tried executing the newly created function and here's what I get:
The EXECUTE permission was denied on
the object 'xxxxxxx', database
'zzzzzzz', schema 'dbo'.
...
I need to increase the size of a field in a table from VARCHAR(100) to VARCHAR(255). For different reasons, this causes the table to be dropped and recreated (along with relationships, FKs, etc). That is acceptable however, I’m performing this change in a SQL2008R2 (express) (or 2008 Express, same result), but the script doesn’t work in ...
I have a SQL query which is written in string and then executed using command Exec(string) like the following :
Declare @TestId bigint = null
Declare @Query nvarchar(max)
set @Query = 'SELECT * from Registrations where RegistrationId = 15 AND (' + CAST(@TestId AS NVARCHAR) + ' IS NULL OR TestId = ' + CAST(@TestId AS NVARCHAR) + ') '
EXE...
I teach SQL Programming in an university. I was thinking to create a submit page that they could upload the .sql file and it automatically checks if the requirements were met, such as creating a database, using a custom CLR dll and so on.
Does anybody have experience in creating that? I got a server running Windows for that.
Thanks in ...
I am trying to figure out the best way to determine global and local mins and maxs for a data set. I think there has got to be an easy way to do this but I cannot figure it out.
I am using Sql Server 2008.
Lets say I have a data set of subscription dates for users.
Start Date Stop Date PersonID
12/31/2007 3/31/2008 ...
I would like to know if exists a way to log all DB trips from Entity Framework.
I have google it, but I didn't found
...
I started looking at this recently with the very limited knowledge that the ASP.NET Cache could somehow make use of a SqlCacheDependency to invalidate the cache when a table (or a queries results) change. This lead me to the SQLDependency and SqlNotificationRequest classes. While the details of the SqlNotificationRequest class still e...