I am using SQL Server 2008.I want to write a stored proc to get values from three tables and each of these will have equal no of rows always.
so i want to merge the row at each level into a single row and insert into a new table (datatypes of source and destination columns are same)
Row1 from table1 and row1 from table2 and row1 from table3 into a single row1 in resulttable
I found a solution but i dont know if its the best performance wise.
Note :dbo.COM_FN_SplitString : it splits a string based on the delimiter passed
Declare @table1 as table(rowID int IDENTITY(1,1),GroupId int)
Declare @table2 as table(rowID int IDENTITY(1,1),Cost Numeric(10,2))
Declare @table3 as table(rowID int IDENTITY(1,1),Currency Varchar(max))
Declare @resultTable as table(GroupId int,Cost Numeric(10,2),Currency Varchar(max))
Insert into @table1(GroupId) SELECT Convert(int,s) as GroupId From dbo.COM_FN_SplitString('1,2,3',',')
Insert into @table2(Cost) SELECT Convert(Numeric(10,2),s) From dbo.COM_FN_SplitString('30.0,35.5,40.0',',')
Insert into @table3(Currency) SELECT s From dbo.COM_FN_SplitString('Dollar,Pound,Dollar',',')
Insert into @resultTable(GroupId,Cost,Currency)
select GroupId,Cost,Currency From
@table1 as t1
@table2 as t2
on t1.rowID = t2.rowID
@table3 as t3
on t3.rowID = t1.rowID
Is there any way to prevent my.mdb file to be open directly?
Actually i want to access it through programming only. Such as by changing the extension or any other way please suggest me.
thanks in advance
Can't you just add a password to the database, use it in your app (through connection string) and not divulge it to the users?
if the connection string is stored somewhere outside the app, make sure to encrypt it, and have your app decrypt it.
I have following Microsoft Visual FoxPro expression:
Iif(a, b, ""), where
a = (IsNull(var1), "Z", var1 <> "A")
b = Iif(IsNull(myDate), Replicate("Z", 10), ConvertTimeToCharacter(myDate, 1))
I have divided this expression to "a" and "b"for better readability
I know that statement "a" should return Boolean value, but why "Z" is present there?
Please, could somebody explain me the meaning of statement "a".
I've looking through Internet without any results.
Thanks in advance!