I am trying to import a csv file to insert data into an existing table on my database. I go through the wizard and when it comes to select source tables and views for the destination, there are none to choose from. It just thinks I am trying to create a new table.
Any suggestions? Thanks!
...
Hi Stakoverflow,
I need to detect a login's default database. Which system table/view should I query for that in SQL Server 2005?
...
Hi,
I have the situation where i have two databases with same structure. The first have some data in its data tables. I need to create a script that will transfer the data from the first database to the second. I have created this script.
DECLARE @table_name nvarchar(MAX),
@query nvarchar(MAX)
DECLARE @table_cursor CURSOR
SE...
I have two databases that are mirrored to another server using database mirroring. The mirror server has to be down for some reason for few days. Now the production server is having principal databases in (PRINCIPAL/DISCONNECTED) State. Clients can access those databases. So what happens when they keep on adding data to these databases?...
Is there a way that i can find out what base tables are being used by views using a custom query or stored procedure?
...
When i query
INFORMATION_SCHEMA.VIEWS it list all views but when i query
INFORMATION_SCHEMA.VIEW_TABLE_USAGE it displays only few views.
How can i rebuild all the views info in INFORMATION_SCHEMA.VIEW_TABLE_USAGE?
...
I've looked at other questions on Stack Overflow related to this question, but none of them seemed to answer this question clearly.
We have a system Stored Procedure called sp_who2 which returns a result set of information for all running processes on the server. I want to filter the data returned by the stored procedure; conceptually,...
I have one dataset that contain at least 500 records. I add columns dinamically to that datast and fill new column using another dataset. this processes is very slow .
I want to know how handle large dataset . how filter rows from large dataset.
...
I'm wishing I could do something like the following in SQl Server 2005 (which I know isnt valid) for my where clause. Sometimes @teamID (passed into a stored procedure) will be the value of an existing teamID, otherwise it will always be zero and I want all rows from the Team table.
I researched using Case and the operator needs to c...
Does any one know how I would have to change the following to work with ms sql?
WHERE registrationDate between to_date ('2003/01/01', 'yyyy/mm/dd')
AND to_date ('2003/12/31', 'yyyy/mm/dd');
What I have read implies I would have to construct it using DATEPART() which could become very long winded. Especially when the goal would be to c...
Hi,
I've a sql table with a primary key(Auto Incremented) and a foreign key.Now I need to modify the table by modifying the foreign key to second primary key so that its values are not allowed to duplicate.
How do i alter my table without affecting the data? Need the sql code.
Regards,
Vix
...
What really is constraints? Why i need to know about them? What are the types of constraints?
...
SQl Server 2005:
Option: 1
CREATE TABLE #test
(customerid, orderdate, field1 INT, field2 INT, field3 INT)
CREATE UNIQUE CLUSTERED INDEX Idx1 ON #test(customerid)
CREATE INDEX Idx2 ON #test(field1 DESC)
CREATE INDEX Idx3 ON #test(field2 DESC)
CREATE INDEX Idx4 ON #test(field3 DESC)
INSERT INTO #test
...
Hi,
Is there any way, to save formatted in database from richtextbox?
I've got richtextbox and some parts of text in this are bold.
string s=richtextbox.Text obviously doesn't work.
And If I can get this formatted text how to save it in Ms Sql Server 2005 ?
...
I want to make a Windows service that will access my database. My database is SQL Server 2005.
Actually I am working on a website and my database is inside our server. I need to access my database every second and update the records. For that purpose I need to make a Windows service that will install into our server and perform the task...
consider table1 with 2 columns..
table1:
column1 int,
column2 char
create procedure SP1(@col1,@col2) as
begin
select * from table1 where _______
end
Question: User may enter valid input for either (col1 or col2) or (both col1 and col2).so i need to validate the user input and use those correct column(s) in the satic query.
...
I am trying to create a link server of a remote database(both the servers are SQL serve2005). I am able to connect that remote server from my SQL Server management studio. I used the following syntax to create it.
EXEC sp_addlinkedserver
@server = N'LINKSQL2005',
@srvproduct = N'',
@provider = N'SQLNCLI',
@provstr = N'S...
Here is the drill, I want to version a database. I have done this before using multiple rows where the table primary key becomes a combination of the row id and either a datestamp or a version #.
Now I want to version a table that depends on many other small tables. Versioning each table will be a giant PITA, so I am looking for goo...
is it possible to retrieve by using connection.getschema() the description item from a sql server table column, just like it's possible to retrieve the column name, data type, is nullable, column default value, etc? if so, how?
...
Hi,
I have to import big xml files to Ms SQL 2005 Database by using C# with high end Performance.
Even if any record fails in middle, i have to take next record for process
and failed record need to log for audit.
I don't want to put insert query with in for loop.
Could you please suggest a best way to do this.
If I can use bulkcopy ...