--Try this:
SELECT distinct *
FROM table2
WHERE NOT EXISTS (SELECT * FROM table1 WHERE table1.a = table2.a)
SELECT *
FROM table2
WHERE NOT EXISTS (SELECT * FROM table1 WHERE table1.a = table2.a)
User Profile
Collapse
-
--Try this
select '99800' + RIGHT (your_column, 5) from your_tableLeave a comment:
-
--Try this:
declare @param1 varchar (10)
declare @param2 varchar (10)
set @param1 = 'Boston'
set @param2 = 'Berkeley'
select * from pubs..publisher s where city in (@param1,@param 2)Leave a comment:
-
--Try using BULK INSERT:
CREATE TABLE SomeTable (Results varchar(1000) null)
BULK INSERT YourDatabase.db o.[SomeTable]
FROM 'd:\yourfile.tx t'
--Or try using TYPE:
CREATE TABLE SomeTable (Results varchar(1000) null)
INSERT INTO SomeTable(Resul ts)
exec ('master..xp_cm dshell ''type d:\yourfile.txt ''')Leave a comment:
-
--Try this
select LEFT (your_column, LEN(your_column )-3) from your_tableLeave a comment:
-
Can you give an example of the output you're looking for? What you have works. See example:
--create sample table
create table XYZ (
Column_1 int,
Column_2 varchar (100),
Column_3 varchar (100)
)
--create sample data
insert XYZ values (1, 'a','b')
insert XYZ values (2, 'b','b')
insert XYZ values (3, 'c','b')
insert XYZ values (4, 'd','b')
...Leave a comment:
-
-- Try this:
SET NOCOUNT ON
DECLARE @ID varchar (50)
DECLARE @Name varchar (200)
DECLARE @StringText varchar(8000)
Declare curBuildString cursor
static for
select distinct id, Name from Table1
OPEN curBuildString
FETCH NEXT FROM curBuildString
INTO @ID, @Name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @StringText...Leave a comment:
-
Try using BULK INSERT:
CREATE TABLE SomeTable (Results varchar(1000) null)
BULK INSERT YourDatabase.db o.[SomeTable]
FROM 'd:\yourfile.tx t'...Leave a comment:
-
Try this:
CREATE TABLE SomeTable (Results varchar(1000) null)
INSERT INTO SomeTable(Resul ts)
exec ('master..xp_cm dshell ''type d:\yourfile.txt ''')Leave a comment:
No activity results to display
Show More
Leave a comment: