arst / ReverseImageSearch

Example application to demonstrate simple implementation of the vector based reverse image search in SQL Server
4 stars 3 forks source link

Parameter Too Large to Pass to SQL Server Function #1

Closed 6Hat closed 7 months ago

6Hat commented 7 months ago

The parameter appears to be way too large to pass over to the sql server. The SQL I am trying to execute is below. I have no idea how this would work?

SELECT * FROM dbo.SimilarImages([0.0,0.0,0.0043545696,1.97781992,2.76731467,0.0,0.0293197725,0.0224884879,0.154900074,0.0,0.193531737,0.00553931,0.0,0.370668173,0.0,0.8676071,0.0,0.161784172,0.00489484053,0.251974583,0.464257151,0.284693867,0.24400939,0.194906726,2.05842757,0.0,0.318568826,0.0,0.0541310832,0.0021613983,1.77198708,1.356197,0.848550439,0.0,0.0,1.56694436,0.724261165,1.42852628,0.5919761,0.204031572,1.865537,2.150036,0.007103604,0.231699049,1.00710714,0.100339308,0.0,0.0,0.142725736,0.0,0.00131854229,0.191905469,0.0,0.0242815074,0.529023,0.853593767,0.42192474,0.0,0.930337965,1.8715812,0.102807336,0.273188949,1.568387,0.446063578,0.8153106,0.0,0.297177285,0.485692769,0.5669699,0.193361461,0.03558284,5.136933,0.3000301,2.53164649,0.0,0.383196235,1.03183556,0.19807522,0.0,1.366579,0.0,0.281099945,1.042502,0.10137599,6.51581764,0.05611366,0.304661065,0.5887933,0.0,0.2816274,0.08550486,0.8756383,0.0,0.026090296,0.0138054891,0.02261737,0.152028888,0.048278898,0.0349334627,0.289105773,1.62043083,1.27769911,0.407789856,0.0,0.2989665,0.813055158,0.0,0.270925432,0.0,0.00128268765,0.230403826,2.56834173,0.00509111257,0.3014748,0.03312537,0.0,0.0,1.35443759,0.3757318,0.280144721,0.0296625551,0.043499846,0.0,0.0383709781,1.610151,0.10776341,0.295988,1.42182863,0.0497232936,0.0,0.1591379,1.19836712,0.0,2.20049667,0.0853714645,0.048273433,0.0548695438,1.449258,0.505235434,0.0,0.0427274853,0.0,0.0,0.167281613,2.704306,1.1954273,0.2586202,0.0,0.384118825,1.84685266,0.2941185,0.0,0.04080566,0.294820756,0.06940791,0.469207525,0.128454208,0.6806438,0.114108659,2.917209,2.238174,0.713591456,0.0,1.25437355,0.251093477,0.0,1.61325133,0.0601888858,1.16314244,0.00051637087,0.195058256,0.9639981,0.0164926536,0.953155339,0.5435737,0.0,1.68044293,0.0,0.3589419,0.239556238,2.92975855,0.5631563,0.522155344,0.3261683,0.42596373,0.9700086,0.0,0.0,0.02243287,0.0,0.0,0.0,0.145736754,0.2477347,0.0732030049,1.48287237,0.249256566,0.905341566,0.646256745,0.08267796,2.50085068,0.03625324,0.156270966,4.40516424,0.0,1.32915664,0.701190233,0.4884645,0.5976088,0.036223568,0.0318001136,0.0,0.10447897,0.0386528075,0.0306559876,1.92314446,0.03293615,0.134326279,0.051895272,0.0110006919,0.09511983,0.3318207,1.32999969,0.0155402236,0.161667645,0.5140819,0.685143232,1.38086176,0.1728855,0.491089135,0.0247057583,0.0,0.271478683,0.0,0.00104522216,1.08942533,0.605397344,0.0,0.0,0.321374059,0.694716334,1.394416,0.007330104,0.8288274,0.7233969,0.129743,0.0,0.0,0.317287683,0.0,0.330046117,0.0,0.296808958,0.0512227975,3.33867717,0.317276776,0.0,0.0,1.35628247,0.172084048,0.8701839,0.0,0.0,1.41483748,0.18281357,3.72902966,0.375946552,0.09313552,0.111636356,0.0,0.156561419,0.09156848,0.0,1.68632627,0.08932908,0.0432126671,0.15528366,4.03339624,0.0163267143,0.123397358,0.6572876,1.92411745,1.14383435,5.59444857,0.04906332,0.0,0.73175,1.34007525,0.0,0.225800887,3.01952887,1.25734568,3.83851314,1.24323046,0.975016057,0.6539582,0.02157626,0.0340019055,0.299937725,0.6624219,0.9214811,0.5106947,0.06334056,0.8133426,7.51677227,3.81795216,2.12481117,1.5270133,0.162096232,0.131685361,0.0300648026,0.0,0.15717493,0.786773264,0.165991187,0.246981159,0.481491953,1.33514369,0.5252793,0.170225769,1.13033807,0.143984571,0.0,0.3862288,3.02824736,0.0,0.376353055,0.428285867,0.0,0.1756415,0.152161717,0.521517336,0.034041822,0.3198526,0.417107731,2.14778256,2.50300026,0.309844941,0.0600410178,0.0,0.0138643589,1.37287784,0.0,0.0,1.9795773,0.235575467,0.448279172,1.03464925,0.219885871,0.125603884,0.06663382,0.6539808,0.0,0.00600487227,0.07645207,0.197045535,0.199384958,0.0159525629,0.421683162,0.100094773,0.3262395,4.703562,0.0,0.0220710766,0.164555848,1.78351188,3.30825,0.0290067736,0.0,1.175848,0.427473456,3.2214663,0.31980288,0.195045665,0.0,0.642041445,1.206803,0.9514549,0.0632870346,0.0,0.04488651,0.209848791,0.0106768319,4.562438,0.07821405,0.0,0.0,7.38325357,0.2617512,1.06755471,0.9611467,0.485885918,1.29676652,0.2814594,0.0425431579,0.050056152,1.27768981,2.40269852,0.236173272,0.11693798,0.005294869,0.114046022,0.0,0.0694715455,0.0384471938,0.6868619,0.5746119,1.54252124,0.4485799,0.199264988,0.964462459,2.314826,0.0271708481,1.35226679,0.0508819073,0.06043075,2.06225848,0.318655878,0.1474103,3.337843,6.73082733,0.9041372,0.12051563,5.484241,0.1022389,2.95957422,0.381826,0.740728557,0.0111228572,0.0583629422,0.0278076436,0.0,0.02239893,2.7939918,0.3334104,5.38329458,0.0,0.475815564,0.292339444,0.0602790564,0.0306840017,0.143161535,0.0,0.8465236,0.0965338,0.0,0.02638798,0.0,0.06984085,0.3428653,0.0,0.8100391,0.0306268036,0.0123050772,0.595860243,1.35872,6.14547968,0.1263641,0.007392786,0.7806353,0.303399622,0.0050109867,0.201901421,0.0,0.0,0.0,2.82790351,0.623324037,0.0,0.571783543,2.403681,0.0250970256,0.33073175,0.6465166,0.00739008328,0.0,0.139251,0.0,1.53603315,0.0,0.6505469,3.20531726,0.503017664,0.146956369,0.006560474,1.43381214,0.3195294,0.01118063,0.7533814,0.715575635,0.154611543,0.4829365,0.0343179479,0.2936611,0.0,0.240132928,0.00485024648,0.0,0.0846481,0.8902067,0.227947414,0.02632313,0.0,1.03260589,1.93378246,0.0515707843,0.0,0.357891232,0.139285073,0.7977709,0.8233678,0.0])

6Hat commented 7 months ago

Disregard. Upon investigation the function so as to recreate it in C# I noticed the parameter was an NVARCHAR()... thus surrounding the parameter in parenthesis fixed the issue, thanks!

arst commented 7 months ago

That is true, sorry for the late response. Glad you've figured it out :)

6Hat commented 7 months ago

This works great by the way, thank you for the post!