hi there Guys!
I am looking for some field, which is compatable with GUID or maybe
some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
(GUID) ?
Any suggestions?
Hi
You cannot convert directly a value as CHAR(n)/VARCHAR(n) as
DECLARE @.str VARCHAR(1)
SET @.str = 'V'
SELECT CAST(@.str as UNIQUEIDENTIFIER)
What do you try to accomplish?
"hack_tick" <sharma.vasudev@.gmail.com> wrote in message
news:1131530112.619103.39140@.z14g2000cwz.googlegro ups.com...
> hi there Guys!
> I am looking for some field, which is compatable with GUID or maybe
> some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
> (GUID) ?
> Any suggestions?
>
|||Thankyou for the Reply, currently I want to add some dozens of Test
data, which are reference across using GUID as the foreign Key, in
order for me to have the foreign key in other table I was looking for
someway to have my own simple GUID so that i can remember what i did :-)
sql
Showing posts with label int. Show all posts
Showing posts with label int. Show all posts
Tuesday, March 27, 2012
field Compatable with uniqueidentifier (GUID)
hi there Guys!
I am looking for some field, which is compatable with GUID or maybe
some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
(GUID) ?
Any suggestions?Hi
You cannot convert directly a value as CHAR(n)/VARCHAR(n) as
DECLARE @.str VARCHAR(1)
SET @.str = 'V'
SELECT CAST(@.str as UNIQUEIDENTIFIER)
What do you try to accomplish?
"hack_tick" <sharma.vasudev@.gmail.com> wrote in message
news:1131530112.619103.39140@.z14g2000cwz.googlegroups.com...
> hi there Guys!
> I am looking for some field, which is compatable with GUID or maybe
> some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
> (GUID) ?
> Any suggestions?
>|||Thankyou for the Reply, currently I want to add some dozens of Test
data, which are reference across using GUID as the foreign Key, in
order for me to have the foreign key in other table I was looking for
someway to have my own simple GUID so that i can remember what i did :-)
I am looking for some field, which is compatable with GUID or maybe
some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
(GUID) ?
Any suggestions?Hi
You cannot convert directly a value as CHAR(n)/VARCHAR(n) as
DECLARE @.str VARCHAR(1)
SET @.str = 'V'
SELECT CAST(@.str as UNIQUEIDENTIFIER)
What do you try to accomplish?
"hack_tick" <sharma.vasudev@.gmail.com> wrote in message
news:1131530112.619103.39140@.z14g2000cwz.googlegroups.com...
> hi there Guys!
> I am looking for some field, which is compatable with GUID or maybe
> some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
> (GUID) ?
> Any suggestions?
>|||Thankyou for the Reply, currently I want to add some dozens of Test
data, which are reference across using GUID as the foreign Key, in
order for me to have the foreign key in other table I was looking for
someway to have my own simple GUID so that i can remember what i did :-)
field Compatable with uniqueidentifier (GUID)
hi there Guys!
I am looking for some field, which is compatable with GUID or maybe
some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
(GUID) ?
Any suggestions?Hi
You cannot convert directly a value as CHAR(n)/VARCHAR(n) as
DECLARE @.str VARCHAR(1)
SET @.str = 'V'
SELECT CAST(@.str as UNIQUEIDENTIFIER)
What do you try to accomplish?
"hack_tick" <sharma.vasudev@.gmail.com> wrote in message
news:1131530112.619103.39140@.z14g2000cwz.googlegroups.com...
> hi there Guys!
> I am looking for some field, which is compatable with GUID or maybe
> some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
> (GUID) ?
> Any suggestions?
>|||Thankyou for the Reply, currently I want to add some dozens of Test
data, which are reference across using GUID as the foreign Key, in
order for me to have the foreign key in other table I was looking for
someway to have my own simple GUID so that i can remember what i did :-)
I am looking for some field, which is compatable with GUID or maybe
some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
(GUID) ?
Any suggestions?Hi
You cannot convert directly a value as CHAR(n)/VARCHAR(n) as
DECLARE @.str VARCHAR(1)
SET @.str = 'V'
SELECT CAST(@.str as UNIQUEIDENTIFIER)
What do you try to accomplish?
"hack_tick" <sharma.vasudev@.gmail.com> wrote in message
news:1131530112.619103.39140@.z14g2000cwz.googlegroups.com...
> hi there Guys!
> I am looking for some field, which is compatable with GUID or maybe
> some function which converts a CHAR/VARCHAR/INT to uniqueidentifier
> (GUID) ?
> Any suggestions?
>|||Thankyou for the Reply, currently I want to add some dozens of Test
data, which are reference across using GUID as the foreign Key, in
order for me to have the foreign key in other table I was looking for
someway to have my own simple GUID so that i can remember what i did :-)
field
I want to have a list of the fileds of a table on the basis of field type.Means only fileds of int type or varchar type this way.Is it possible?You probably want something like:SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE 'dba_holiday' = TABLE_NAME
AND 'datetime' = DATA_TYPE-PatP
FROM INFORMATION_SCHEMA.COLUMNS
WHERE 'dba_holiday' = TABLE_NAME
AND 'datetime' = DATA_TYPE-PatP
Sunday, February 26, 2012
fancy select needed.Thanks for your help!
Here you go:
create table tt (
colA int,
colB varchar(10)
)
insert into tt values(1,'NAME 1')
insert into tt values(1,'NAME 2')
insert into tt values(2,'NAME 3')
insert into tt values(2,'NAME 4')
insert into tt values(2,'NAME 5')
select * from tt
colA colB
-- --
1 NAME 1
1 NAME 2
2 NAME 3
2 NAME 4
2 NAME 5
select cola, col1, col2, col3 = ( select min(colb) from
tt where tt2.cola = tt.cola and tt.colb > tt2.col2 )
from
(
select cola, col1, col2 = ( select min(colb) from tt
where tt1.cola = tt.cola and tt.colb > tt1.col1 )
from
(
select cola, min(colb) col1
from tt
group by cola
) tt1
) tt2
cola col1 col2 col3
-- -- -- --
1 NAME 1 NAME 2 NULL
2 NAME 3 NAME 4 NAME 5
>--Original Message--
>Hi,
>I have a table like the following:
>
>ID | Name
>--
>1 | Name 1
>1 | Name 2
>2 | Name 3
>2 | Name 4
>2 | Name 5
>
>I now want to do a select which results in the following:
>ID | Name
>--
>1 | Name 1, Name 2
>2 | Name 3, Name 4, Name 5
>Does anybody know how this could be done? Thank you a
lot in advance!
> Daniel
>.
>Thank you!
"Lito Dominguez" <anonymous@.discussions.microsoft.com> schrieb im
Newsbeitrag news:197d01c504b3$217eeab0$a601280a@.phx.gbl...
> Here you go:
> create table tt (
> colA int,
> colB varchar(10)
> )
> insert into tt values(1,'NAME 1')
> insert into tt values(1,'NAME 2')
> insert into tt values(2,'NAME 3')
> insert into tt values(2,'NAME 4')
> insert into tt values(2,'NAME 5')
> select * from tt
> colA colB
> -- --
> 1 NAME 1
> 1 NAME 2
> 2 NAME 3
> 2 NAME 4
> 2 NAME 5
> select cola, col1, col2, col3 = ( select min(colb) from
> tt where tt2.cola = tt.cola and tt.colb > tt2.col2 )
> from
> (
> select cola, col1, col2 = ( select min(colb) from tt
> where tt1.cola = tt.cola and tt.colb > tt1.col1 )
> from
> (
> select cola, min(colb) col1
> from tt
> group by cola
> ) tt1
> ) tt2
> cola col1 col2 col3
> -- -- -- --
> 1 NAME 1 NAME 2 NULL
> 2 NAME 3 NAME 4 NAME 5
>
> lot in advance!
create table tt (
colA int,
colB varchar(10)
)
insert into tt values(1,'NAME 1')
insert into tt values(1,'NAME 2')
insert into tt values(2,'NAME 3')
insert into tt values(2,'NAME 4')
insert into tt values(2,'NAME 5')
select * from tt
colA colB
-- --
1 NAME 1
1 NAME 2
2 NAME 3
2 NAME 4
2 NAME 5
select cola, col1, col2, col3 = ( select min(colb) from
tt where tt2.cola = tt.cola and tt.colb > tt2.col2 )
from
(
select cola, col1, col2 = ( select min(colb) from tt
where tt1.cola = tt.cola and tt.colb > tt1.col1 )
from
(
select cola, min(colb) col1
from tt
group by cola
) tt1
) tt2
cola col1 col2 col3
-- -- -- --
1 NAME 1 NAME 2 NULL
2 NAME 3 NAME 4 NAME 5
>--Original Message--
>Hi,
>I have a table like the following:
>
>ID | Name
>--
>1 | Name 1
>1 | Name 2
>2 | Name 3
>2 | Name 4
>2 | Name 5
>
>I now want to do a select which results in the following:
>ID | Name
>--
>1 | Name 1, Name 2
>2 | Name 3, Name 4, Name 5
>Does anybody know how this could be done? Thank you a
lot in advance!
> Daniel
>.
>Thank you!
"Lito Dominguez" <anonymous@.discussions.microsoft.com> schrieb im
Newsbeitrag news:197d01c504b3$217eeab0$a601280a@.phx.gbl...
> Here you go:
> create table tt (
> colA int,
> colB varchar(10)
> )
> insert into tt values(1,'NAME 1')
> insert into tt values(1,'NAME 2')
> insert into tt values(2,'NAME 3')
> insert into tt values(2,'NAME 4')
> insert into tt values(2,'NAME 5')
> select * from tt
> colA colB
> -- --
> 1 NAME 1
> 1 NAME 2
> 2 NAME 3
> 2 NAME 4
> 2 NAME 5
> select cola, col1, col2, col3 = ( select min(colb) from
> tt where tt2.cola = tt.cola and tt.colb > tt2.col2 )
> from
> (
> select cola, col1, col2 = ( select min(colb) from tt
> where tt1.cola = tt.cola and tt.colb > tt1.col1 )
> from
> (
> select cola, min(colb) col1
> from tt
> group by cola
> ) tt1
> ) tt2
> cola col1 col2 col3
> -- -- -- --
> 1 NAME 1 NAME 2 NULL
> 2 NAME 3 NAME 4 NAME 5
>
> lot in advance!
Subscribe to:
Posts (Atom)