Imagine I have two tables: Manager, Player.This is for a football team, where several players can play for one manager only and a manager manages several (11) players.
When designing the relationship in Sql Server, at the time the popup window comes up with the properties for the relationship, does it matter which side the tables are?
...
How can I get back the autogenerated ID for a new record I just inserted?
(Using ASP classic and MSSQL 2005)
...
Is there any way to use a query and join two tables that is in two different database on the same server for DbVisualizer? I used the following for the SQL server
Select * from table union select * from datbase.dbo.table2
I tried this for the DbVisualizer, and it didnt work. How do I do this?
...
Is there a simple way to convert a date stored in a varchar in the format mon-yy (e.g. "Feb-09") to a datetime which will convert any invalid values to null.
I'm currently using string manipulation combined with a case statement but it's rather cumbersome.
...
After some network maintenance last weekend, we had some trouble with our development server which led to us restart it. Some updates were installed during the restart, which may or may not have been a factor. Since then, we have been unable to connect to SQL Server 2005, even locally via Management Studio. Depending on the protocol used...
I am using T-SQL query directly in Microsoft SQL Server Studio's Query window against to a large Oracle DB, and my SQL server is 2005.
I have created a linked server as myOracleServer. By using the following T-SQL query:
SELECT COUNT(*) FROM myOracleServer..owner.myTable WHERE id = 1000 AND Dt = '2009-02-26'
It take more than 1 minut...
I am lost in a big database and I am not able to find where the data I get comes from. I was wondering if it is possible with SQL Server 2005 to search for a string in an all the tables, rows and columns of a DB?
Does anybody has an idea if it is possible and how?
Thanks!
...
Is there any way to install SQL Express 2005 silently while configuring to allow remote access, or must the configuration be done with the SQL Server Management Studio UI?
...
I have the following call to Oracle db:
DECLARE @myCount int;
DECLARE @sql NVARCHAR;
SET @sql = N'SELECT COUNT(*) FROM owner.myTable';
EXEC (@sql) AT oracleServer
-- how to get result count to @myCount?
where oracleServer is a linked server to Oracle. How can I pass the count result out to a varaible @myCount? I tried:
EXEC (@sql, @m...
How do I change a default "New Query" template in SSMS 2005?
...
I am using the following T-SQL query in SQL server 2005 (Management Studio IDE):
DECLARE @id int;
DECLARE @countVal int;
DECLARE @sql nvarchar(max);
SET @id = 1000;
SET @sql = 'SELECT COUNT(*) FROM owner.myTable WHERE id = @id';
EXEC (@sql) AT oracleServer -- oracleServer is a lined server to Oracle
I am not sure how to pass the input...
I have 2 table TableA and TableB I want to insert all records at a time from TableA to TableB if the records are not in TableB
Please help thank you
...
Is it possible to use the users windows authentication (setting in iis) for database connections in PHP?
This is possible in the .NET world through a technique called "impersonation". Does this also exist in the PHP/IIS world?
EDIT: The Database I am using is MS SQL Server 2005.
...
Hi everybody,
I'm having a problem with an sql query that i use for my mobile application which uses sql server 2005 ce. I'm not so good with t-sql, so have a problem with this query
SELECT TP.ID_TASK_MASTER, TP.ID_PROBLEM, TP.ID_TASK_PROBLE, P.DS_PROBLEM,
TP.SW_HASOK, TP.SW_HASNOK, TP.SW_HASTOK, TP.SW_HASVALUE,
TP.NO_...
I am using MSSQL 2005 Server and I have the following SQL query.
IF @CategoryId IN (1,2,3)
BEGIN
INSERT INTO @search_temp_table
SELECT * FROM (SELECT d.DataId, (SELECT [Name] FROM Category WHERE CategoryId = d.CategoryId) AS 'Category', d.Description, d.CompanyName, d.City, d.CategoryId,
d.CreatedOn, d.Rank, d.vot...
I am using the FULLTEXT in my sql query to search the records.
SELECT * FROM (SELECT d.DataId, (SELECT [Name] FROM Category WHERE CategoryId = d.CategoryId) AS 'Category', d.Description, d.CompanyName, d.City, d.CategoryId,
d.CreatedOn, d.Rank, d.voteCount, d.commentCount, d.viewCount
FROM Data d
...
I am providing search functionality in my website, when user searches a record then I want to display the time the query taken to get the results same as google does. When we search anything then google displays how much time it takes to get results?
For this I have declared a @start variable in my SP and finding the difference in the e...
I have 2 tables as follows on Sql Server 2005 database
Request(RequestId int, Filter xml)
DataTable(Id int,.....)
The filter column has a list of ids from datatable as xml for e.g. 1013
Now I want to select the data from DataTable that match the ids in the filter xml. Here is what I have come up with
select d.*
from request
...
I am trying to return Xml value from SQL Server 2005 using For Xml. Is there any limit in the size of xml returned from SQL Server?
I will be using ExecuteXmlReader to get the value in my C# code.
Also, is there any limit on the data that can hold in an XmlReader?
Any thoughts...
...
If I have thousands of hierarchical records to take from database and generate xml, what will be the best way to do it with a good performance and less CPU utilization?
...