Please help me in writing a query to import the comma separated data in a text file to sqlserver 2000.
Below is the sample data from the text file.
100,1,xx,yy,20030101
100,2,21,t4,20030101
100,3,2p,01,20030101
100,1,xx,yy,20030102
100,2,21,t5,20030102
100,3,2p,01,20030102
I want the output...
I have a written a query which is not producing the desired output.Please help me in getting the output.
select b.id,emp,city,gender,age from tablea a full outer join tableb b on a.id=b.id
Tablea
------
id emp city
------------ --------------------...
Please give me your valuable suggestions for the below sceniaro.
We will get a flatfiles every day which i need to export the data into sqlserver 2000.The flat files which may contains more than 350 columns some of columns data may be nulls.
What is the best way to address the above scenario...
I need the help in getting the output.
if A1 exists in the @prod3 table then the @prod2 table prod2 value for the respective sid should be A1
Please help me in getting the desired output.thanks for yur help in advance..
declare @Prod1 table
(
Csid bigint,
sid bigint
)
insert into @Prod1...
I want to export the data to a file with space separated.
Ex:
Location Length
-------- ------
Col1value 1 10
Column2 12 2
Col3value 18 3
Please help me.I did tried by enabling in the tools- options-results tab.
I want to rename the column name of the table which contains data and also i want to check and replace the column name in the stored procedures(50), views(20) and some triggers. Please suggests me the best way to replace it .
One way is to generate the scripts and find & replace( CTRL H)with...
Below is my query which will diplay the results.
select E.Colname
,max( case when CRF.RCD = '02' then CRF.RCD else null end)'Sm02'
,max( case when CRF.RCD = '03' then CRF.RCD else null end)'S03'
,max( case when CRF.RCD = '01' then CRF.RCD else null end)'I01'...
I need a help in getting the output.
I want to display the values of T5 to 1,T3 to 2,T1 to 5.When the count is > then 1 it should be 4.
declare @Prod1 table
(
Csid bigint,
sid bigint
)
insert into @Prod1
select 4103, 101 union all
select 4101, 195 union all
select 4103, 101 Union all
select...
Please help..
I am writing a update query which has to update the @prod2 table column prod1 with the values of @Upprod table column prod2.
Please correct the query if anything needs to be corrected in the below query.
there are nearly 1500 records to be updated below is sample data..
declare...
Please help me in writing the query.
Thanks for your help in advance...
Table1
------
accid state County cp
----- ----- ----- ---
804102 AR 338 TA
804101 AZ 339 TB
table2
------
accid item1 item2 PE createddate
----- ----- ----- --- -----------...
Please correct me in getting the below output after executing the query:
UPDATE Employees SET ST_NAME = UPPER('STNAME')
UPDATE Employees SET ST_NAME = UPPER('STNAME'),
COUNTYNAME = UPPER('COUNTYNAME')
Below is my query:
declare @TblName varchar(50)
declare @Col1 varchar(50)
declare...
I am getting syntax error for the below.Please correct me..
CREATE PROCEDURE dbo.spUpdateUp
@TblName varchar(50),
@numofcol number,
@Col1 varchar(50),
@Col2 varchar(50),
@Col3 varchar(50),
@Col4 varchar(50)
AS
SET NOCOUNT ON
declare @vsSQL nvarchar(8000), @Col varchar(50)...
I want to write a generic stored procedure in sqlserver 2000.which should update the data in uppercase..it should not hard coded as below.
Please help me in rewriting the generic code..when tablename or field passed it should update in the respective tables.
CREATE Procedure dbo.UpdateUP...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.