I have the following table, let's call it People:
id | customer | shipper | buyer |
1 | 1 | 2 | 3 |
2 | 4 | 5 | 6 |
3 | 7 | 8 | 9 |
And this ties in to a User_ID table:
id | Name |
1 | Stan |
2 | Brian |
3 | Amy |
What's the best practice f...
I am using VS 2005
I am new to asp.net i have a project created in asp.net c# which is using sql server express edition local database.
there is a app_data folder there is *.mdf file inside i can see it also i can browse the tables from it.
In app data folder i can see there are few .sql scripts
named
CreateAllObjects.sql
DeleAllData...
Hi all,
I have undertaken a small project which already evolved a current database. The application was written in php and the database was mysql.
I am rewriting the application, yet I still need to maintain the database's structure as well as data. I have received an sql dump file. When I try running it in sql server management studi...
Hi, is there a way I can write a script to find all tables with a given filter (e.g. all tables that start with "tbl_") and copy them (structure only) but adding a new standard column to each one?
I'm using SQL server 2008.
Thanks in advance.
...
I want to display rows as column in SQL Server.
My table looks like this:
images_id item_id images_name
-------------------------------
1 1 image1.jpg
2 1 image2.jpg
3 1 image3.jpg
4 2 image4.jpg
5 2 image5.jpg
6 2 image6.jpg
I'd ...
Trying to switch to SQLNCLI so I can use varchar(max) fields in my ASP application. No records are returned from a query that worked fine under SQLOLEDB.
The connection string opens as follows:
ConnStr="Provider=SQLNCLI10;Server=129.118.139.78,8888;Server=UWCTest;Uid=user;Pwd=pass;DataTypeCompatibility=80;MARS Connection=true;"
oConn....
What happens to the system agent tables whenever the database server is restarted? More specifically, does SQL Server assign new job_ids to each job when they are run after the reset, or does the job_id stay the same?
...
I am a student this is my LAST homework assignment : )
/*
**(4.9) Calculate the minimum salary for exempt employees
**and the maximum salary for non-exempt employees.
*/
I can only use one select statement... or without running two separate queries
I have 2 tables...
Job_title
(Job_title varchar (50) PRIMARY KEY,
EEO_1_Classificatio...
i am running this:
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql -E -S Sql server-hl7\timeclockplus timeclockplus.sql -oresults.txt
and it doesnt like that there are spaces in the directory. how do i fix this problem?
...
i would like to have a BAT file open a sql server script
currently i have this code in the sql file:
declare @path varchar(255), @mydb varchar(50)
SELECT @mydb = 'timeclockplus'
select @path = 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\' + @mydb + '-' + convert(varchar(8),getdate(),112) + '.bak'
BACKUP DATABASE @mydb T...
I'm having an issue with temp tables using an ADO connection to my database. The select into queries run fine, but it seems that they are dropping the tables after each select into. Their is no open recordset so I am unsure as to why the tables are dropping, it shouldn't be opening a 2nd ADO connection that I can see.
Any idea what I ca...
I've inherited a database and know an nHibernate engine was used on top of it.
Inside the database I see CSV values representing multiple identities instead of "proper" link tables being used for primary and foreign keys.
For example one tuple looks like this:
PersonID, int: 1
Name, varchar: John Smith
Edus, varchar: "76,5262,...
I know SQL Server 2008 Express can be installed side by side with SQL Server 2005 Express, but but am not sure, and have not found any useful posts about if it is possible to install SQL Server 2008 Express along side a SQL Server 2005 Standard install.
Thanks!
...
Sorry for the long post, but most of it is code spelling out my scenario:
I'm trying to execute a dynamic query (hopefully through a stored proceedure) to retrieve results based on a variable number of inputs.
If I had a table:
(dbo).(People)
ID Name Age
1 Joe 28
2 Bob 32
3 Alan 26
4 Joe 27
I want to allo...
I am trying to populate a date table which contains every date for the next 35 years with information regarding each day.
My ERP system has an accounting years table (GLRULE) which specifies the accounting periods for each specific year since many companies do not work on Calendar Months.
The GLRule table contains one record for each...
I'm doing a small bit of refactoring, however, I'd like to check to see if the current primary key I'd like to change is currently being referenced as a foreign key in any other tables. The schema I'm working with is quite large so it is not a viable option to scan through each table in the schema.
...
The target is a SQL server 2000 on remote host with firewall. Is it possible to create a link server on my local SQL server 2008 SSMS?
If yes, what should I pay attention to? And what ports should be open too? Thanks.
...
Looking for the easist/most scalable way to do a set "difference" in SQL Server see below.
If you can't tell from the picture i am looking for everything that is not in the intersection.
I have seen one way to do it:
select * from (
(select 'test1' as a, 1 as b)
union all
(select 'test2' as a , 2 as b union all select ...
So I have an application that connects to our SQLServer.
This works on any server behind the firewall just fine.
When i put it out on our live server, outside the firewall the connection to the sqlserver fails with this error
A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The serve...
Hello I am new in creating stored procedure can you help me how to do this.
Error:
Incorrect syntax near the keyword 'AS'.
Must declare scalar variable @Serial.
CREATE PROCEDURE sp_SIU
-- Add the parameters for the stored procedure here
@Serial varchar(50),
@Part varchar(50),
@Status varchar(50),
AS
-- SET NOCOUNT ON...