I am not sure what is up with the conversion to nvarchar, I see data like:
????????†††††††???????????????
I should be seeing data like:
"Notify payroll of new employee"
I must be doing something wrong still!
Think there might be some lag in the posting
Catadmin couldnt reply to my post (this is the original post) and so created a new post here:
http://www.tek-tips.com/viewthread.cfm?qid=1096304&page=1
Thank you for the assistance so far, I will try your last example in a short while and try...
What I find intertesting is that the NULL (marked with red) character does'nt prevent you from converting it back, but it does seem to limit amost every client I have played with's abiltity to show the characters after it."
You hit the nail on the head. Thats what I was trying to find a way to...
Good reply from Catadmin
I've used CAST and CONVERT to set a variable, not on the variable itself.
Set @Var = Cast(MyValue as DataType)
and
Set @Var = Convert(Datatype, MyValue)
But, until you mentioned it, I had never tried it directly. I just tested in in QA and didn't seem to have a...
Please correct me if this is wrong:
Because the data is stored in binary, it takes 2 characters for each ASCII letter.
In 0xFFFFFFFFFF30303030303030303031202020202020202020202020202020200A00
The 0x is ignored as it just indicates the data is in Hex.
The FF is translated as ÿ
the 30 is...
I don't get a good result with this, I must be missing something:
declare @b varbinary(8000)
set @b = 0xFFFFFFFFFF30303030303030303031...
select cast(@b as nVarchar(4000))
The data as it sits in the table is already set as a 175 width binary column. (Column Name=FixedColumnData...
QA truncates the data at the 00 for me, it appears to be a terminator internally.
Catadmin suggested:
Try using PATIndex or CharIndex to locate your 00 value, then use Substring() to pull the first half of the string into one variable and the second half of the string into a second variable...
It makes sense, I haven't used PATIndex or CharIndex before, but it seems like now is as good a time as any to learn them!
Thank you for the help. Just in advance, have you tried using CAST on a variable?
Maybe I posted in the wrong area. I am using MS SQL 2000.
I have 254 tables in the database
Each of them has over 1000 rows of data.
I want to use the first 1000 rows from every table and create a new database with those rows.
I could use:
set rowcount = 1000
select * from database..table...
Stumbled across my old documentation and also found this one:
/*
** This file will delete dupe rows from a table based on a column list. ie., the compound value of the chosen column list is used to determine dupe status and subsequent delete status. We construct some dynamic SQL and use the...
Is there an easy way to copy 1000 rows from every table in the database to a new database.
I was thinking about:
set rowcount=1000
INSERT INTO [1435530ODR2]..AAPROCQT
SELECT * FROM [1435530-R]..AAPROCQT
But then I would have to detail all 1700 tables, uggg
Thanks in advance.
Recht
Here is what I ended up using with the original database/table names, thanks for all the help. I made all of the T-SQL statements in a red font in the copy I sent out.
If anyone has any suggestions or comments please don't hesitate to make them!
--BACKUP THE DATABASE!!! Do this before you do...
Thank you that helps, is there any way to do this without copying the files into a new or temp table?
I was thinking about maybe modifying something like this?
Declare @min int,
@IID int
SET @min = 1
WHILE @min <> 0 BEGIN
Set rowcount 1
SELECT @IID = (Select Top 1 iID from #Test Group by...
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.